#include <iostream> #include <string> using namespace std; string in; int n = 0; int main() { while(getline(cin, in)) { int pos = in.find("you"); while(pos != -1) { in.erase(pos, 3); in.insert(pos, "we"); pos = in.find("you"); } cout << in << endl; } return 0; } |
Double click to view unformatted code.