#include <iostream>
#include <cstring>
const int MAX = 1000+10;
using namespace std;
int main()
{
char ch[MAX];
while(cin.getline(ch, MAX))
{
int n = strlen(ch);
for(int i = 0; i <= n-1-2; i++)
{
if(!strncmp(ch+i, "you", 3))
{
strncpy(ch+i, "we", 2);
int j = i+2;
for(; j < n; j++)
ch[j] = ch[j+1];
}
}
cout<<ch<<endl;
}
return 0;
}
字符串替换
最新推荐文章于 2023-04-16 17:39:37 发布