이것이 취업을 위한 코딩 테스트다. with 파이썬 - 나동빈
Java
public class FromUpToDown {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int N = Integer.parseInt(br.readLine());
ArrayList<Integer> arr = new ArrayList<>();
for(int i = 0; i < N; i++) {
arr.add(Integer.parseInt(br.readLine()));
}
arr.sort(Collections.reverseOrder());
for(int i : arr) {
System.out.print(i + " ");
}
}
}
Python
N = int(input())
arr = []
for i in range(N):
arr.append(int(input()))
arr = sorted(arr, reverse=True)
for i in arr:
print(i, end=' ')