View Code of Problem 3496

#include<stdio.h>
#include<string.h>
int main()
{
    char s[1000],p[3];
    int i,j=0;
    while(gets(s)!=EOF)
    {
        for(i=0;i<strlen(s);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<strlen(s);j++)
                  s[j]=s[j+1];
            }
        printf("%c",s[i]);
        }
    }
}

Double click to view unformatted code.


Back to problem 3496