hihocoder1082
1 #include2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #define lson l, m, rt<<114 #define rson m+1, r, rt<<1|115 #define IO ios::sync_with_stdio(false);cin.tie(0);16 #define INF 0x3f3f3f3f17 #define MAXN 10001018 const int MOD=1e9+7;19 typedef long long ll;20 using namespace std;21 int t, n, m;22 string s, ss, a = "marshtomp", b = "fjxmlhx"; 23 int main()24 {25 IO;26 while(getline(cin, ss)){27 s = ss;28 transform(s.begin(), s.end(), s.begin(), ::tolower);//全部转小写字母 29 int t = s.find(a);//找(串)30 while(t != -1){31 ss.erase(t, 9);s.erase(t, 9);//擦除(位置,个数)32 ss.insert(t, b);s.insert(t, b);//插入(位置,串)33 t = s.find(a);34 }35 cout << ss << endl;36 }37 return 0;38 }