#12. 数组元素翻转

    ID: 12 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatArray-1gesp3一维数组

数组元素翻转

Reverse Array

Background

Congcong is currently learning about array operations. He encountered a simple task that requires reversing the order of elements in a fixed-length integer array.

Problem Description

Given an array of integers of length 33, return a new array with the elements in reverse order. For example, {1,2,3}\{1, 2, 3\} becomes {3,2,1}\{3, 2, 1\}.

Input Format

Input is given from standard input in the following format.

An array containing 33 integers, in the format [a b c], where a,b,ca, b, c are integers.

Output Format

Output is printed to standard output in the following format.

An array containing 33 integers in reverse order, in the format [c, b, a], where c,b,ac, b, a are the reversed integers.

Sample

[1 2 3]
[3, 2, 1]
[5 11 9]
[9, 11, 5]
[7 0 0]
[0, 0, 7]

Sample Explanation

For the first sample, the input array is [1 2 3], and reversing its elements yields [3, 2, 1].

Constraints

Time limit: 11 second, Memory limit: 10241024 KiB for each test case.