Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. char v[103];
  4. int main()
  5. {
  6. int n, cnt=0, p=1;
  7. cin >> n;
  8. char ch, prev=0;
  9. for(int i=1 ;i <= n; i++){
  10. cin >> ch;
  11. if(ch == 97 || ch == 101 || ch == 105 || ch == 117 || ch == 121 || ch == 111)
  12. cnt=1;
  13. if(cnt == 1){
  14. prev=ch;
  15. cnt=0;
  16. }
  17. else {
  18. if(prev!=0){
  19. v[p]=prev;
  20. p++;
  21. prev=0;
  22. }
  23. v[p]=ch;
  24. p++;
  25. }
  26.  
  27. }
  28. if(prev!=0){
  29. v[p]=prev;
  30. p++;
  31. prev=0;
  32. }
  33. for(int i=1; i <= p; i++)
  34. cout << v[i];
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement