Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- int j;
- int i;
- string word, word_2;
- j = 0;
- word = "";
- word_2 = "";
- cout << "enter a word" << endl;
- cin >> word;
- while (!(word == "end" || word == "End" || word == "END" || word == "eND" || word == "enD" || word == "ENd"))
- {
- for (i = 0; i < word.size(); i++)
- {
- if (word[i] == 'a' || word[i] == 'e' || word[i] == 'i' || word[i] == 'o' || word[i] == 'u' || word[i] == 'A' || word[i] == 'E' || word[i] == 'I' || word[i] == 'O' || word[i] == 'U')
- {
- ++j;
- }
- }
- for (i = 0; i < word.size(); i++)
- {
- if (word[i] == 'a' || word[i] == 'e' || word[i] == 'i' || word[i] == 'o' || word[i] == 'u' || word[i] == 'A' || word[i] == 'E' || word[i] == 'I' || word[i] == 'O' || word[i] == 'U')
- {
- word_2 = word_2 + word[i] + "_";
- }
- else
- {
- word_2 = word_2 + word[i];
- }
- }
- cout << endl << "the total number of vowels in " << word << " is " << j << endl << word_2 << endl << endl;
- j = 0;
- word = "";
- word_2 = "";
- cout << "enter a word" << endl;
- cin >> word;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement