daily pastebin goal
23%
SHARE
TWEET

Untitled

a guest Feb 17th, 2018 471 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. const string V = "aeiouy";
  6.  
  7. bool vowel(char c)
  8. {
  9.     return V.find(c) != -1;
  10. }
  11.  
  12. int main()
  13. {
  14.     int n;
  15.     cin >> n;
  16.     string s;
  17.     cin >> s;
  18.     cout << s[0];
  19.     for(int i = 1; i < n; i++)
  20.         if (!vowel(s[i - 1]) || !vowel(s[i]))
  21.             cout << s[i];
  22.     cout << endl;
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top