-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path6_7.cpp
More file actions
28 lines (24 loc) · 698 Bytes
/
6_7.cpp
File metadata and controls
28 lines (24 loc) · 698 Bytes
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
// By luckycallor
// Welcome to my site: www.luckycallor.com
#include<iostream>
#include<string>
#include<cctype>
using namespace std;
int main()
{
int vowels = 0,consonants = 0,others = 0;
string word;
while(cin >> word){
char ch = word[0];
if(isalpha(ch)){
if(ch == 'a' || ch == 'o' || ch == 'e' || ch == 'i' || ch == 'u') vowels++;
else if(ch == 'q' && word.size() == 1) break;
else consonants++;
}
else others++;
}
cout << vowels << " wors beginning with vowels." << endl;
cout << consonants << " words beginning with consonants." << endl;
cout << others << " others." << endl;
return 0;
}