View Code of Problem 3496

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

int main(){ 
    char str[1005];
    while(scanf("%[^\n]",str)!=EOF){
        getchar();
        char ans[1005];
        int k=0;
        for(int i=0;i<strlen(str);){
            if(str[i]=='y'&&str[i+1]=='o'&&str[i+2]=='u'){
                ans[k++]='w';
                ans[k++]='e';
                i+=3;
            }else{
                ans[k++]=str[i];
                i++;
            }
        }
        for(int i=0;i<k;i++){
            printf("%c",ans[i]);
        }
        printf("\n");
    }
	return 0;
}

Double click to view unformatted code.


Back to problem 3496