Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- char cuv[256][256];
- void invers(int i)
- {
- int n=strlen(cuv[i]);
- for(int j=0;j<n/2;++j)
- swap(cuv[i][j],cuv[i][n-1-j]);
- }
- int main()
- {
- char s[256],*p,separator[]=" ";
- cin.getline(s,256);
- p=s;
- p=strtok(p,separator);
- int n=0;
- while(p)
- {
- strcpy(cuv[n],p);
- ++n,p=strtok(NULL,separator);
- }
- for(int i=0;i<n;++i)
- cout<<cuv[i]<<' ',invers(i),cout<<cuv[i]<<' ';
- cout<<'\n';
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement