View Code of Problem 3496

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

Double click to view unformatted code.


Back to problem 3496