#12. 数组元素翻转
数组元素翻转
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 , return a new array with the elements in reverse order. For example, becomes .
Input Format
Input is given from standard input in the following format.
An array containing integers, in the format
[a b c], where are integers.
Output Format
Output is printed to standard output in the following format.
An array containing integers in reverse order, in the format
[c, b, a], where 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: second, Memory limit: KiB for each test case.