Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <algorithm>
- #include <string>
- using namespace std;
- int main() {
- int n, j = 0;
- string str;
- bool flag;
- cin >> n;
- for (int i = 0; i < n; i++) {
- cin >> str;
- str += '%';
- j = 0;
- while (j < str.size()) {
- flag = false;
- if ((str[0] == 'e' || str[0] == 'E') && str.size() > 1) {
- flag = true;
- if (str[0] == 'e') { str = 'a' + str; str[1] = 'e'; }
- if (str[0] == 'E') { str = 'A' + str; str[1] = 'e'; }
- j += 2;
- }
- if (j != 0 && str[j] == 's' && str[j + 1] != 'h') {
- flag = true;
- str += '%';
- int k = str.size() - 2;
- for (; k >= j; k--) {
- str[k] = str[k - 1];
- }
- str[j] = 't';
- str[j + 1] = 'h';
- j += 2;
- }
- if (str[j] == 'o' && str[j + 1] == 'o') {
- flag = true;
- str[j + 1] = 'u';
- j += 2;
- while (str[j] == 'o') j++;
- }
- if(!flag)j++;
- }
- for (int cha = 0; cha < str.size() - 1; cha++) {
- cout << str[cha];
- }
- cout << endl;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment