fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main(void) {
  5. char sntc[150];
  6. char word[30];
  7. char *found;
  8. size_t wordlen;
  9. fgets(sntc,sizeof(sntc),stdin);
  10. fgets(word,sizeof(word),stdin);
  11. wordlen=strlen(word)-1;
  12. word[wordlen]=0;
  13. while((found=strstr(sntc,word))!=NULL)
  14. memmove(found,found+wordlen,strlen(found+wordlen)+1);
  15. printf("%s",sntc);
  16. return 0;
  17. }
Success #stdin #stdout 0s 9424KB
stdin
merhaba dunyali nasilsin
 dunyali
stdout
merhaba nasilsin