PAT乙题1009. 说反话 (20)

2018/01/25 PAT 共 524 字,约 2 分钟
#include<iostream>
#include<algorithm>
#include<stdio.h>
#include<string.h>
#include<map>
#include<string>
#include<fstream>
#include<vector>
#include<stack>
#include<functional>
using namespace std;

int main() {
#ifdef LOCAL
	freopen("d:\\datain.txt", "r", stdin);
	freopen("d:\\dataout.txt", "w", stdout);
#endif LOCAL
	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;
}

Search

    Table of Contents