forked from ndb796/python-for-coding-test
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path10.java
More file actions
25 lines (18 loc) ยท 617 Bytes
/
10.java
File metadata and controls
25 lines (18 loc) ยท 617 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
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// N์ ์
๋ ฅ๋ฐ๊ธฐ
int n = sc.nextInt();
// N๊ฐ์ ์ ์๋ฅผ ์
๋ ฅ๋ฐ์ ๋ฆฌ์คํธ์ ์ ์ฅ
Integer[] arr = new Integer[n];
for (int i = 0; i < n; i++) {
arr[i] = sc.nextInt();
}
// ๊ธฐ๋ณธ ์ ๋ ฌ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ด์ฉํ์ฌ ๋ด๋ฆผ์ฐจ์ ์ ๋ ฌ ์ํ
Arrays.sort(arr, Collections.reverseOrder());
for(int i = 0; i < n; i++) {
System.out.print(arr[i] + " ");
}
}
}