View Code of Problem 3496

#include<iostream>
using namespace std;
int main(void){
	string s;
	while(getline(cin,s)){
		int j=0;
		for(int i=0;i<s.length();i++){
			if(s[i]=='y'&&s[i+1]=='o'&&s[i+2]=='u'){
				s[i]='w';s[i+1]='e'; 
				for(j=i+2;j<s.length()-1;j++){
					s[j]=s[j+1];
				}
				s[j]='\0';
			}
		}
		cout<<s<<endl;
	}
}

Double click to view unformatted code.


Back to problem 3496