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] + " ");
}
}
}