알고리즘/백준

[정렬]2750번 수 정렬하기

개발자 뱅 2023. 6. 11. 23:56
반응형
출처 :  https://www.acmicpc.net/problem/2750

 

Problem

 

Code

import java.io.*;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.parseInt(br.readLine());
        int[] nList = new int[N];

        for (int i = 0; i < nList.length; i++) 
            nList[i] = Integer.parseInt(br.readLine());
        

        Arrays.sort(nList);

        for (int val : nList) {
            System.out.println(val);
        }
    }
}
반응형