View Code of Problem 3496

#include<stdio.h>
#include <string.h>
#include <math.h>
int main(){
	char s[1000];
	int i;
	while(scanf("%s",&s)!=EOF){
		int n=strlen(s);
		for(i=0;i<n-2;i++){
			if(s[i]=='y'&&s[i+1]=='o'&&s[i+2]=='u')
			{
				s[i]='w';
				s[i+1]='e';
		        s[i+2]='*';
			 } 
		}
		for(i=0;i<n;i++){
			if(s[i]=='*')
			continue;
			printf("%c",s[i]);
		}
		printf("\n");
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 3496