Advertisement
Spocoman

02. Special Items

Nov 22nd, 2023 (edited)
956
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     string text, vowels = "aeiou";
  8.     getline(cin, text);
  9.  
  10.     for (int i = 1; i < text.length(); i++) {
  11.         if (text[i - 1] == text[i] && vowels.find(text[i]) == -1) {
  12.             text.erase(i, 1);
  13.             i--;
  14.         }
  15.     }
  16.  
  17.     cout << text << endl;
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement