#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
string s;
getline(cin,s);
int len=s.size();
for(int i=len-1;i>=0;i--)
{
if(s[i]==' ')
{
string s1;
char *p=&s[i];
s1.assign(p+1,s.end());
cout<<s1<<" ";
s.erase(p,s.end());
}

}
cout<<s<<endl;
return 0;
}

posted on 2015-05-13 23:11  三人纷纷  阅读(399)  评论(0编辑  收藏  举报