-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDay07.java
More file actions
27 lines (18 loc) · 723 Bytes
/
Day07.java
File metadata and controls
27 lines (18 loc) · 723 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
import java.io.*;
import java.util.*;
public class Day07 {
public static void main(String[] args) throws IOException {
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(bufferedReader.readLine().trim());
String[] arrTemp = bufferedReader.readLine().replaceAll("\\s+$", "").split(" ");
List<Integer> arr = new ArrayList<>();
for (int i = 0; i < n; i++) {
int arrItem = Integer.parseInt(arrTemp[i]);
arr.add(arrItem);
}
for (int j = arr.size() - 1; j >= 0; j--){
System.out.printf("%d ", arr.get(j));
}
bufferedReader.close();
}
}