Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<cstring>
- using namespace std;
- int main()
- {
- char s[101],cuv[11],p[101];
- cin.getline(s,101);
- cin>>cuv;
- int i=0,j=0,k,m=0,ok;
- while(j<strlen(s))
- {
- ok=1;
- k=0;
- while(s[j]!=' '&&s[j]!='\0')
- {
- if(cuv[k]!=s[j])
- ok=0;
- p[m]=s[j];
- k++;
- j++;
- m++;
- }
- if(ok==1)
- {
- p[m]='#';
- m++;
- p[m]=' ';
- m++;
- }
- else
- {
- p[m]=' ';
- m++;
- }
- i=j=j+1;
- }
- m++;
- p[m]='\0';
- cout<<p;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement