P16450 [HackerRank] Arrays ds
普及-
题目描述

An array is a type of data structure that stores elements of the same type in a contiguous block of memory. In an array, $A$, of size $N$, each memory location has some unique index, $i$ (where $0\leq i<N$), that can be referenced as $A[i]$ or $A_i$.

Reverse an array of integers.

Note: If you've already solved our C++ domain's Arrays Introduction challenge, you may want to skip this.

Example

$A=[1,2,3]$

Return $[3,2,1]$.

Function Description

Complete the function reverseArray in the editor below.

reverseArray has the following parameter(s):

int A[n]: the array to reverse

Returns

int[n]: the reversed array

Input Format

The first line contains an integer, $N$, the number of integers in $A$.

The second line contains $N$ space-separated integers that make up $A$.

Constraints

$1\leq N\leq10^3$
$1\leq A[i]\leq10^4,$where $A\begin{bmatrix}i\end{bmatrix}$ is the $i^{t h}$ integer in A

输入格式

见题面

输出格式

见题面

样例输入
4 1 4 3 2
样例输出
2 3 4 1