#include<stdio.h> #include<string.h> int main() { char str[1000],c[10]; while(gets(str)) { int len=strlen(str); int i,j; for(i=0;i<len;i++) { if(str[i]=='o') { for(j=i;j<i+10;j++) c[j-i]=str[j]; if(strcmp(c,"occupation")==0) { printf("OH-OH-OH-QQ-PEI-PEI-SHION"); i=i+9; } else printf("%c",str[i]); }else printf("%c",str[i]); } printf("\n"); } } |
Double click to view unformatted code.