Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <iostream>
  2. #include <string.h>
  3. using namespace std;
  4. int main()
  5. {
  6. char a[100],b[100],t[1000],*p,c[100];
  7. cin.getline(a,100);
  8. cin.getline(b,100);
  9. strcpy(c,"aaaaa");
  10. p=strstr(a,b);
  11. while(p!=NULL)
  12. {
  13. strcpy(t,p+strlen(b));
  14. *p=NULL;
  15. strcat(a,c);
  16. strcat(a,t);
  17. p=strstr(a,b);
  18. }
  19. cout<<a;
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement