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 s[101], cuv[16], aux[100], *p;
- int k;
- cin.get(s, 101);
- cin>>cuv;
- k=strlen(cuv);
- p=strstr(s, cuv);
- if(!p)
- cout<<"nu apare";
- else
- {
- while(p)
- {
- strcpy(aux, p+k);
- strcpy(p+k, "?");
- strcpy(p+k+1, aux);
- p=strstr(p+k, cuv);
- }
- }
- cout<<"cuvantul modificat este: "<<s;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement