View Code of Problem 3496

#include<bits/stdc++.h>
using namespace std; 

int main()
{
	string a, b = "we";
	while(getline(cin, a))
	{
		while(a.find("you") != -1)
		{
			a.replace(a.find("you"), 3, b);
		}
		cout << a << endl;
	}
	return 0;
}

/*
F:\temp\22496739.30269\Main.cc:2:24: error: bits/stdc++.h: No such file or directory
F:\temp\22496739.30269\Main.cc: In function 'int main()':
F:\temp\22496739.30269\Main.cc:7: error: 'string' was not declared in this scope
F:\temp\22496739.30269\Main.cc:7: error: expected ';' before 'a'
F:\temp\22496739.30269\Main.cc:8: error: 'cin' was not declared in this scope
F:\temp\22496739.30269\Main.cc:8: error: 'a' was not declared in this scope
F:\temp\22496739.30269\Main.cc:8: error: 'getline' was not declared in this scope
F:\temp\22496739.30269\Main.cc:12: error: 'b' was not declared in this scope
F:\temp\22496739.30269\Main.cc:14: error: 'cout' was not declared in this scope
F:\temp\22496739.30269\Main.cc:14: error: 'endl' was not declared in this scope
*/

Double click to view unformatted code.


Back to problem 3496