Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<cstring>
- #include<stdio.h>
- using namespace std;
- int main()
- { char s[256],c1[20],c2[20],sep[]=" .,",*p;
- aux[256];
- gets(s);
- gets(c1);
- gets(c2);
- p=strtok(s,sep);
- while(p)
- {
- if(strcmp(p,c1)==0)
- {
- strcpy(aux,p);
- strcpy(p,c2);
- strcpy(c2,aux);
- }
- cout<<p<<" ";
- p=strtok(NULL,sep);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement