//#include<bits/stdc++.h> #include<iostream> #include<string> #include<vector> #include<cmath> #include<algorithm> #include<cctype> using namespace std; //3496 //13 19 23 28 36 60 61 62 96 97 99 104 108 120 // 没看明白18 //66高精度88背包问题动态规划 int main() { string str1; string str2; while (getline(cin,str1)) { str2 = ""; for (int i(0); i < str1.length(); ++i) { if (i < str1.length() - 2 && str1[i] == 'y' && str1[i + 1] == 'o' && str1[i + 2] == 'u') { str2 += "we"; i += 2; } else { str2 += str1[i]; } } cout << str2 << endl; } return 0; } |
Double click to view unformatted code.