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], *p ;
- cin>>a;
- cin>>b;
- p=strstr(a,b);
- int l=strlen(b);
- if(p==0)
- cout<<"Nu exista subsirul respectiv.";
- else
- do
- {
- strcpy(p, p+l);
- p=strstr(p, b);
- }while(p);
- cout<<a;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement