Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- using namespace std;
- int main()
- {
- char a[100],b[100],t[1000],*p,c[100];
- cin.getline(a,100);
- cin.getline(b,100);
- strcpy(c,"aaaaa");
- p=strstr(a,b);
- while(p!=NULL)
- {
- strcpy(t,p+strlen(b));
- *p=NULL;
- strcat(a,c);
- strcat(a,t);
- p=strstr(a,b);
- }
- cout<<a;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement