View Code of Problem 3496

#include<iostream>
using namespace std;
int main()
{
	string s;
	while(getline(cin,s))
	{
		string str;
		for(int i = 0;i < s.size();)
		{
			if(i+2 < s.size() && s[i] == 'y' && s[i+1] == 'o' && s[i+2] == 'u')
			{
				str += "we";
				i += 3;
			}
			else
			{
				str += s[i];
				i += 1;
			}
		}
		cout << str << endl;
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 3496