View Code of Problem 3496

#include<iostream>
#include<string>
using namespace std;
int main()
{
	string sk;
	int pos;
	while( getline(cin,sk) )
	{
		while( (pos=sk.find("you")) != sk.npos)
		{
			sk.replace(pos,3,"we");
//			cout<<"pos="<<pos<<"*"<<sk<<"*"<<sk.size()<<"*"<<endl;
		}
		cout<<sk<<endl;
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 3496