Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<cstring>
- #include<fstream>
- using namespace std;
- char s[101],a[11],b[11],*p,t[101];
- int main()
- { ifstream fin("inlocuirecuvant.in");
- ofstream fout("inlocuirecuvant.out");
- fin>>a;
- fin>>b;
- fin.get();
- fin.getline(s,101);
- p=strtok(s," ");
- while(p)
- {
- if(strcmp(p,a)==0)
- strcat(t,b);
- else
- strcat(t,p);
- strcat(t," ");
- p=strtok(NULL," ");
- }
- fout<<t;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement