Advertisement
Nusrat_Ullah

UVa 483 tiny

Nov 11th, 2018
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.     size_t z,x;
  6.     string s,w;
  7.     while(getline(cin,s)){
  8.         x=count(s.begin(),s.end(),' ');
  9.         z=0;
  10.         stringstream ss(s);
  11.         while(ss>>w){
  12.             reverse(w.begin(),w.end());
  13.             z++;
  14.             if(x!=(z-1))cout<<w<<" ";
  15.         }
  16.         cout<<w<<endl;
  17.     }
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement