View Code of Problem 3496

#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
int main() {
	char c[10000];
	int len;
	while(gets(c)) {
		len=strlen(c);
		for(int i=0; i<len; i++) {
			if(i+2<=len-1&&c[i]=='y'&&c[i+1]=='o'&&c[i+2]=='u') {
				c[i]='w';
				c[i+1]='e';
				for(int j=i+2; j<len-1; j++) c[j]=c[j+1];
				len--;
			}
		}
		c[len]='\0';
		for(int i=0; i<len; i++) cout<<c[i];
		cout<<endl;
	}
}

Double click to view unformatted code.


Back to problem 3496