Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. string s = "aeiouy";
  6. bool isIn (char current) {
  7. for (auto x : s) {
  8. if (x == current) {
  9. return true;
  10. }
  11. }
  12. return false;
  13. }
  14.  
  15. int main () {
  16. int n;
  17. char current, last = 0;
  18. cin >> n;
  19. for (int i = 1; i <= n; ++i) {
  20. cin >> current;
  21. if (!(isIn(current) and isIn(last))) {
  22. cout << current;
  23. }
  24. last = current;
  25. }
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement