forked from jaege/Cpp-Primer-5th-Exercises
-
Notifications
You must be signed in to change notification settings - Fork 0
/
5.10.cpp
32 lines (30 loc) · 731 Bytes
/
5.10.cpp
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
#include <iostream>
int main() {
unsigned aCnt = 0, eCnt = 0, iCnt = 0, oCnt = 0, uCnt = 0;
char ch;
while (std::cin >> ch) {
switch(ch) {
case 'A': case 'a':
++aCnt;
break;
case 'E': case 'e':
++eCnt;
break;
case 'I': case 'i':
++iCnt;
break;
case 'O': case 'o':
++oCnt;
break;
case 'U': case 'u':
++uCnt;
break;
}
}
std::cout << "Number of vowel a: " << aCnt << '\n'
<< "Number of vowel e: " << eCnt << '\n'
<< "Number of vowel i: " << iCnt << '\n'
<< "Number of vowel o: " << oCnt << '\n'
<< "Number of vowel u: " << uCnt << std::endl;
return 0;
}