上海交通大学机试 Zero-complexity Transposition Easy

基本思想:

无;

关键点:

无;

#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
using namespace std;


int main() {
	int n;
	int a;
	while (cin >> n) {
		vector<int>vec;
		for (int i = 0; i < n; i++) {
			cin >> a;
			vec.push_back(a);
		}
		for (int i = vec.size() - 1; i >= 0; i--) {
			if (i == vec.size() - 1)
				cout << vec[i];
			else
				cout << " " << vec[i];
		}
		cout << endl;
	}
	return 0;
}

  

猜你喜欢

转载自www.cnblogs.com/songlinxuan/p/12405778.html