SHARE
TWEET

Untitled

a guest Dec 9th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.     string s,ss;
  6.     getline(cin,s);
  7.     istringstream buffer(s);
  8.     vector<string> v;
  9.     for(string word;buffer>>word;)
  10.         v.push_back(word);
  11.     for(int i=0;i<v.size();i++)
  12.     {
  13.         s=ss=v[i];
  14.         reverse(ss.begin(),ss.end());
  15.         v.insert(v.begin()+i+1,ss),i++;
  16.     }
  17.     for(int i=0;i<v.size();i++)
  18.         cout<<v[i]<<" ";
  19.     return 0;
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top