Advertisement
Guest User

TT

a guest
Apr 10th, 2020
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include<iostream>
  2. #include<sstream>
  3. #include<algorithm>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     string str,wd;
  9.     getline(cin,str);
  10.  
  11.     stringstream ss(str);
  12.     string word;
  13.     int i=0;
  14.     while(ss>>word)
  15.     {
  16.         i++;
  17.         reverse(word.begin(),word.end());
  18.         if(i==1)cout<<word;
  19.         else cout<< " "<<word;
  20.     }
  21.     cout<<endl;
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement