Created
June 20, 2020 09:43
-
-
Save 2hanX/5e06c3e02de38f7e79d3579969e48245 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<string> | |
#include<cctype> | |
using namespace std; | |
int main() | |
{ | |
string a; | |
cout << "Enter words (q to quit): " << endl; | |
int v = 0; | |
int c = 0; | |
int o = 0; | |
cin >> a; | |
while (a != "q") | |
{ | |
if (isalpha(a[0])) | |
{ | |
switch (a[0]) | |
{ | |
case 'a': | |
case 'A': | |
case 'e': | |
case 'E': | |
case 'i': | |
case 'I': | |
case 'o': | |
case 'O': | |
case 'u': | |
case 'U': | |
v++; | |
break; | |
default: | |
c++; | |
break; | |
} | |
} | |
else | |
o++; | |
cin >> a; | |
} | |
cout << v << " words beginnig with vowels" << endl; | |
cout << c << " words beginnig with consonants" << endl; | |
cout << o << " others" << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment