-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDay-7.java
More file actions
28 lines (22 loc) · 686 Bytes
/
Day-7.java
File metadata and controls
28 lines (22 loc) · 686 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static void main(String[] args) {
// Get the input
Scanner sc = new Scanner(System.in);
int length = sc.nextInt();
int[] array = new int[length];
for (int i = 0; i < length; i++) {
array[i] = sc.nextInt();
}
// Var holding our new string
String result = "";
for (int i = array.length - 1; i >= 0; i--) {
result = result + array[i] + " ";
}
System.out.println(result);
}
}