Input String : I am a good boy
Output String : boy good a am I
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s,st,w;
int i;
getline(cin,s);
istringstream is(s);
st="";
while(is>>w)
{
st=w+' '+st;
}
cout<<st<<endl;
return 0;
}
Tech Blog & Tutorials
0 comments:
Post a Comment