NYOJ 113

 1 #include<iostream>
 2 #include<string>
 3 using namespace std;
 4 
 5 int main()
 6 {
 7      int pos=-1;
 8      string s;
 9      while(getline(cin,s))
10      {
11           while((pos=s.find("you",pos+1))!=s.npos)//不可写成s::npos 
12                s.replace(pos,3,"we");
13           cout<<s<<endl;
14      }
15      return 0;
16 }

 

posted @ 2012-09-09 16:23  加拿大小哥哥  阅读(148)  评论(0)    收藏  举报