Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- size_t z,x;
- string s,w;
- while(getline(cin,s)){
- x=count(s.begin(),s.end(),' ');
- z=0;
- stringstream ss(s);
- while(ss>>w){
- reverse(w.begin(),w.end());
- z++;
- if(x!=(z-1))cout<<w<<" ";
- }
- cout<<w<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement