View Code of Problem 3496

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

Double click to view unformatted code.


Back to problem 3496