string.find(); 和 string.replace();的用法。
#include <iostream>
#include <string>
using namespace std;
int main(){
string str;
int p;
while(getline(cin, str)){
p = str.find("you");
while(p != string::npos){
str.replace(p, 3, "we");
p = str.find("you", p + 1);
}
cout << str << endl;
}
return 0;
}