Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int i;
- string q;
- stringstream wq;
- vector<string>sa;
- while(getline(cin,q)){
- wq<<q;
- while(wq>>q){
- reverse(q.begin(),q.end());
- sa.push_back(q);
- }
- for(i=0;i<(int)sa.size();i++){
- if(i==(sa.size()-1))cout<<sa[i]<<endl;
- else cout<<sa[i]<<" ";
- }
- sa.clear();
- wq.clear();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment