// 0942.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <stack> #include <iostream> #include <string> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { stack<string> strstack; string strword; while(cin >> strword) strstack.push(strword); while (!strstack.empty()) { cout << strstack.top() << " "; strstack.pop(); } return 0; }