View Code of Problem 3496

#include<iostream>
#include<cstring>
#include<string.h>
#include<stdio.h>
using namespace std;
int main(){
	char a[1200],fin[1200];
	while(gets(a)){
		int op = 0;
		for(int i = 0;i<strlen(a);i++){
			if(a[i] == 'y' && a[i+1] == 'o' && a[i+2] == 'u'){
				fin[op++] = 'w';
				fin[op++] = 'e';
				i+=2;
			}else{
				fin[op++] = a[i];
			}
		}
		for(int i = 0;i<op;i++)cout<<fin[i];
		cout<<endl;
	}
	return 0;
} 

Double click to view unformatted code.


Back to problem 3496