Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- string s = "aeiouy";
- bool isIn (char current) {
- for (auto x : s) {
- if (x == current) {
- return true;
- }
- }
- return false;
- }
- int main () {
- int n;
- char current, last = 0;
- cin >> n;
- for (int i = 1; i <= n; ++i) {
- cin >> current;
- if (!(isIn(current) and isIn(last))) {
- cout << current;
- }
- last = current;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement