Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <string>
- using namespace std;
- int main()
- {
- string word = "turpentine and turtles";
- vector <char> vowels = { 'a','e','i','o','u' };
- vector <char> result;
- for (int i = 0; i < word.size();i++)
- {
- for (int j = 0; j < vowels.size();j++)
- {
- if (word[i] == vowels[j])
- {
- result.push_back(word[i]);
- if (word[i] == 'e' || word[i] == 'u') {
- result.push_back(word[i]);
- }
- }
- }
- }
- for (int k = 0; k < result.size();k++)
- {
- cout << result[k];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement