PS/BaekJoon

10989 JAVA ์ˆ˜ ์ •๋ ฌํ•˜๊ธฐ 3

chaerlo127 2022. 7. 7. 15:18
728x90

 

 


 

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;


public class Main {

	public static void main(String[] args) {
		BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		try {
			int a = Integer.parseInt(buffer.readLine());
			int[] array = new int[a];
			for(int i = 0 ; i< a ; i++) {
				array[i] = Integer.parseInt(buffer.readLine());
			}
			buffer.close();
			
			Arrays.sort(array);
			
			for(int i = 0; i< a; i++) {
				sb.append(array[i]).append("\n");
			}
			System.out.println(sb);
		} catch (NumberFormatException | IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
728x90