Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<sstream>
- #include<algorithm>
- using namespace std;
- int main()
- {
- string str,wd;
- getline(cin,str);
- stringstream ss(str);
- string word;
- int i=0;
- while(ss>>word)
- {
- i++;
- reverse(word.begin(),word.end());
- if(i==1)cout<<word;
- else cout<< " "<<word;
- }
- cout<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement