我一次性AC这道题,用时20分钟。
#include<iostream>
#include<sstream>
using namespace std;
int main()
{
// freopen("xxx.in","r",stdin);
// freopen("yyy.out","w",stdout);
string s,n1,n2="";
stringstream ss;
getline(cin,s);
ss<<s;
while(ss>>n1)
{
n2=' '+n1+n2;
}
n2.erase(0,1);
cout << n2;
// fclose(stdin);
// fclose(stdout);
return 0;
}