Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<string>
- #include<string.h>
- #include<algorithm>
- #include<vector>
- using namespace std;
- bool check(char c)
- {
- return (c == 'u'||c=='e'||c == 'o'||c=='a'||c=='i') ? true:false;
- }
- int main() {
- int t;cin>>t;cin.ignore();
- while (t--)
- {
- string s;cin>>s;int k = 0;
- string t ="";
- for (int i = 0; s[i] != '\0'; i++)
- {
- if(check(s[i])) t+= s[i];
- }
- for (int i = 0,j = t.length()-1; s[i] != '\0'; i++)
- {
- if (check(s[i])&&j >= 0)
- {
- cout<<t[j--];
- }
- else
- {
- cout<<s[i];
- }
- }
- cout<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement