#include #include #include using namespace std; int main() { string text; cout << "Please enter some text: "; cin >> text; int vowels = 0; int consonants = 0; for(int i = 0 ; i < text.length() ; i++) if(isalpha(text[i])) switch(tolower(text[i])) { case 'a': case 'e': case 'i': case 'o': case 'u': vowels++; break; default: consonants++; } cout << "Your input contained " << vowels << " vowels and " << consonants << " consonants." << endl; return 0; }