View Code of Problem 3496

#include<stdio.h>
#include<math.h>
#include<string.h>
#include <iostream>
#include<algorithm>
using namespace std;
int main() 
{	
	string str;
	string ans="we";
	while(getline(cin,str))
	{
		string temp="you";
		int flag=0;
		while(1)
		{
			int len=-1;
			len=str.find(temp);
			if(len!=-1)
			{
				str.replace(len,3,ans);				
			}
			else
				break;
		}
		cout<<str<<endl;
	}
}

Double click to view unformatted code.


Back to problem 3496