You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
762 B
C++

#include <cstdio>
#include <cctype>
#include <cstring>
using namespace std;
char str[215], ans[215];
bool check(int x)
{
char *tgt = "marshtomp";
for (int i = 0; i < 9; i++)
if (tolower(str[x + i]) != tgt[i])
return false;
return true;
}
int main()
{
while (fgets(str, 205, stdin))
{
int len = strlen(str);
if (len < 9)
printf(str);
else
{
int e = 0;
for (int i = 0; i < len; i++)
if (!check(i))
ans[e++] = str[i];
else
strcpy(ans + e, "fjxmlhx"), e += 7, i += 8;
ans[e] = '\0';
printf(ans);
}
}
return 0;
}