For my test run I have to use "unquestionably", but I can't anything to work. Here's what I have so far.
Expand|Select|Wrap|Line Numbers
- #include <iostream>
- #include <string>
- #include <cstring>
- using namespace std;
- void stringout();
- string input;
- int main()
- {
- cout << "Input a string of characters: " ;
- cin >> input;
- cout << "You entered: " << input << endl;
- stringout();
- return 0;
- }
- void stringout()
- {
- char ch;
- int vowel=0, consonant=0;
- int length = input.length();
- for (int i = 0; i < length; i++)
- {
- if ((ch == 'a') || (ch == 'e') || (ch == 'i') || (ch == 'o') || (ch == 'u') ||
- (ch == 'A') || (ch == 'E') || (ch == 'I') || (ch == 'O') || (ch == 'U'))
- ++vowel;
- else
- ++consonant;
- }
- cout << "This has " << input.length() << " characters, " <<endl;
- }