View Code of Problem 3496

#include<stdio.h>
#include<string.h>
int main()
{
	char a[1000];
	while(gets(a))
	{
		for(int i=0;i<strlen(a);i++)
		{
			if((a[i-1]==' '||i==0)&&a[i]=='y'&&a[i+1]=='o'&&a[i+2]=='u')
			{
				printf("we");
				i+=2;
			}
			else
			{
				printf("%c",a[i]);
			}
		}
		printf("\n");
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 3496