https://pintia.cn/problem-sets/994805260223102976/problems
#include<iostream>
#include<stack>
#include<algorithm>
using namespace std ;
stack < string > st ;
int main()
{
string s ;
while( cin >> s)
st.push(s);
cout <<st.top();
st.pop();
while(!st.empty() )
{
cout << " ";
cout << st.top();
st.pop();
}
return 0;
}