blob: 27c8a71072bafcd0387ebd936afa9948fa0aaced (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#include <iostream>
/*
*
* 5.10
*
* Same as 5.9 because i already considered capital letters
*/
int main () {
char Character = 0;
int Va = 0;
int Ve = 0;
int Vi = 0;
int Vo = 0;
int Vu = 0;
int NonVowel = 0;
while(std::cin >> Character) {
if(Character == 'a' || Character == 'A') {
++Va;
} else if (Character == 'e' || Character == 'E') {
++Ve;
} else if (Character == 'i' || Character == 'I') {
++Vi;
} else if (Character == 'o' || Character == 'O') {
++Vo;
} else if (Character == 'u' || Character == 'U') {
++Vu;
} else {
++NonVowel;
}
}
std::cout << "A: " << Va << "\n"
<< "E: " << Ve << "\n"
<< "I: " << Vi << "\n"
<< "O: " << Vo << "\n"
<< "U: " << Vu << "\n"
<< "Non Vowel: " << NonVowel << std::endl;
return 0;
}
|