#include<iostream>
#include<string>
using namespace std;
int main()
{
string str;
while(true)
{
getline(cin, str);
if(cin.eof()) break;
int index;
while(true)
{
index = str.find("you");
if(index == string::npos) break;
str.replace(index, 3, "we", 2);
}
cout<<str<<endl;
}
return 0;
}
原文:http://www.cnblogs.com/cwenliu/p/5928117.html