blob: 460e0e88066bac336453e613fa887687fa6c4ffa (
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
43
44
45
46
47
48
49
50
51
52
53
54
|
#include <iostream>
/*
*
* 5.11
*
*
*/
int main () {
char Character = 0;
uint32_t Va = 0;
uint32_t Ve = 0;
uint32_t Vi = 0;
uint32_t Vo = 0;
uint32_t Vu = 0;
uint32_t BlankSpace = 0;
uint32_t Tabs = 0;
uint32_t Newlines = 0;
uint32_t Other = 0;
while(std::cin.get(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 if (Character == '\n') {
++Newlines;
} else if (Character == '\t') {
++Tabs;
} else if (Character == ' ') {
++BlankSpace;
} else {
++Other;
}
}
std::cout << "A: " << Va << "\n"
<< "E: " << Ve << "\n"
<< "I: " << Vi << "\n"
<< "O: " << Vo << "\n"
<< "U: " << Vu << "\n"
<< "Tabs: " << Tabs << "\n"
<< "Newlines: " << Newlines << "\n"
<< "Blank Space: " << BlankSpace << "\n"
<< "Others: " << Other << std::endl;
return 0;
}
|