hihocoder 1082 然而沼跃鱼早就看穿了一切(字符串替换)

时间:2023-03-08 23:04:05
hihocoder 1082 然而沼跃鱼早就看穿了一切(字符串替换)
时间限制:1000ms
单点时限:1000ms
内存限制:256MB

描述

hihocoder 1082 然而沼跃鱼早就看穿了一切(字符串替换)

fjxmlhx每天都在被沼跃鱼刷屏,因此他急切的找到了你希望你写一个程序屏蔽所有句子中的沼跃鱼(“marshtomp”,不区分大小写)。为了使句子不缺少成分,统一换成 “fjxmlhx” 。

输入

输入包括多行。

每行是一个字符串,长度不超过200。

一行的末尾与下一行的开头没有关系。

输出

输出包含多行,为输入按照描述中变换的结果。

样例输入
The Marshtomp has seen it all before.
marshTomp is beaten by fjxmlhx!
AmarshtompB
样例输出
The fjxmlhx has seen it all before.
fjxmlhx is beaten by fjxmlhx!
AfjxmlhxB
 #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
char s[];
int main(){
while(gets(s)){
int len = strlen(s);
for(int i = ; s[i] != '\0'; i++){
if((s[i] == 'M' || s[i] == 'm') && (s[i + ] == 'A' || s[i + ] == 'a')
&& (s[i + ] == 'R' || s[i + ] == 'r') && (s[i + ] == 'S' || s[i + ] == 's')
&& (s[i + ] == 'H' || s[i + ] == 'h') && (s[i + ] == 'T' || s[i + ] == 't')
&& (s[i + ] == 'O' || s[i + ] == 'o') && (s[i + ] == 'M' || s[i + ] == 'm')
&& (s[i + ] == 'P' || s[i + ] == 'p')){
printf("fjxmlhx");
i += ;
} else {
//printf("%c", s[i]);
putchar(s[i]);
}
}
cout << endl;
}
return ;
}