View Code of Problem 3496

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int main() {
	char s[1000];
	while(gets(s)!=NULL)
	{
		int len=strlen(s),i,j;
		for(i=0;i<len;i++)
		{
			if(s[i]=='y')
			{
				i++;
				if(s[i]=='o')
				{
					i++;
					if(s[i]=='u')
					{
						s[i]='*';
						s[i-1]='e';
						s[i-2]='w';
					}
				}
			}
		}
		for(j=0;j<len;j++)
		{
			if(s[j]!='*')
			{
				printf("%c",s[j]);
			}
		}
		printf("\n");
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 3496