Files

24 lines
631 B
Java
Raw Permalink Normal View History

2017-02-12 00:31:12 -08:00
// Author: Rodney Shaghoulian
2018-07-27 16:45:56 -07:00
// Github: github.com/RodneyShag
// HackerRank: hackerrank.com/RodneyShag
2017-02-12 00:31:12 -08:00
2017-02-09 02:12:38 -08:00
import java.util.Scanner;
public class Solution {
2017-09-11 09:32:17 -07:00
public static void main(String[] args) {
2017-04-05 18:42:35 -05:00
/* Save input */
2017-02-18 23:43:07 -06:00
Scanner scan = new Scanner(System.in);
int size = scan.nextInt();
int [] array = new int[size];
for (int i = 0; i < size; i++) {
array[i] = scan.nextInt();
2017-02-09 02:12:38 -08:00
}
2017-02-18 23:43:07 -06:00
scan.close();
2017-02-09 02:12:38 -08:00
/* Print elements in reverse order */
for (int i = size - 1; i >= 0; i--) {
2017-02-18 23:43:07 -06:00
System.out.print(array[i] + " ");
2017-02-09 02:12:38 -08:00
}
}
}