#include<stdio.h> #include<string.h> int main(void){ char str[1000]; char a[5]="you"; char b[5]="we"; while(gets(str)!=NULL){ char *t; t=strtok(str," "); do{ if(strcmp(t,a)==0){ printf("%s",b); } else printf("%s",t); printf(" "); }while(t=strtok(NULL," ")); } } |
Double click to view unformatted code.