View Code of Problem 3496

#include<stdio.h>
#include<string.h>
int main()
{
	char s[1000];
  	while(gets(s))
        {
        	int i,j;
          	for(i=0;s[i]!='\0';i++)
                {
                	if(s[i]=='y'&&s[i+1]=='o'&&s[i+2]=='u')
                        {
                        	s[i]='w';
                          	s[i+1]='e';
                          	for(j=i+2;s[j]!='\0';j++)
                                {
                                	s[j]=s[j+1];
                                }
                          	s[j] = '\0';
                          	i=i+2;
                        }
                }
          	puts(s);
        }
  	return 0;
}

Double click to view unformatted code.


Back to problem 3496