首页 > 试题广场 >

Zero-complexity Transposition

[编程题]Zero-complexity Transposition
  • 热度指数:12805 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 64M,其他语言128M
  • 算法知识视频讲解
You are given a sequence of integer numbers. Zero-complexity transposition of the sequence is the reverse of this sequence. Your task is to write a program that prints zero-complexity transposition of the given sequence.

输入描述:
For each case, the first line of the input file contains one integer n-length of the sequence (0 < n ≤ 10 000). The second line contains n integers numbers-a1, a2, …, an (-1 000 000 000 000 000 ≤ ai ≤ 1 000 000 000 000 000).


输出描述:
For each case, on the first line of the output file print the sequence in the reverse order.
示例1

输入

5
-3 4 6 -8 9

输出

9 -8 6 4 -3
头像 渺小小螃蟹
发表于 2021-05-13 12:17:50
#include<iostream> #include<cstdio> #include<stack> using namespace std; int main() { int n; stack<long long> seque 展开全文
头像 牛客440904392号
发表于 2024-09-30 17:00:53
n = input() print(' '.join(input().split()[::-1]))
头像 牛客440904392号
发表于 2024-09-30 17:05:56
import java.util.Scanner; import java.util.Stack; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(Sy 展开全文
头像 小花Student
发表于 2024-01-20 20:20:25
#include<iostream> const int MAX_SIZE = 10000; class Stack { private: long long int data[MAX_SIZE]; int top=-1; public: 展开全文
头像 52Ulpianus
发表于 2023-01-17 22:40:20
#include <iostream> using namespace std; int main() { int num,i; cin >> num; int* stack = new int[num]; for(i = 0;i < 展开全文
头像 lyw菌
发表于 2023-02-13 18:00:54
#借用栈的思想,但要注意题目要求用long long类型,不过这道题用int也能对#include "stdio.h"#include "stack"usingnamespacestd;intmain(){intn;longlongtemp;stack<longlong&g 展开全文
头像 rainman_
发表于 2023-02-26 15:16:06
#include <iostream> #include <stack> #include <cstdio> using namespace std; //大数要用lld int main() { int n; stack<long lon 展开全文
头像 立志实干
发表于 2021-03-06 09:35:38
#include <iostream> #include <cstdio> #include <stack> using namespace std; stack<long long> Num; int main(){ int n; 展开全文
头像 chong_0428
发表于 2024-03-02 16:43:31
while True: try: n = int(input()) s = list(map(int,input().split())) for i in s[::-1]: print(i,end=' ') ex 展开全文
头像 这破程序员一秒都不想当了
发表于 2024-03-13 21:43:36
#include <iostream> #include <cstdio> #include <vector> using namespace std; vector<long long> l; int main() { int counte 展开全文