PAT 1009 说反话 (20 分)
2018-12-12 本文已影响0人
昭明ZMing
#include <iostream>
#include <stack>
using namespace std;
int main() {
stack<string> v;
string s;
while(cin >> s) v.push(s);//入站
cout << v.top();//站顶
v.pop();//弹出站顶
while(!v.empty()) {
cout << " " << v.top();
v.pop();
}
return 0;
}