Created
May 31, 2022 03:50
-
-
Save mym0404/b6d1aad8e4f549066e43604fdc711a4a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
public class Main { | |
public static void main(String[] args) throws IOException { | |
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | |
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); | |
int n = Integer.parseInt(br.readLine()); | |
ArrayList<Integer> arr = new ArrayList<>(); | |
for(int i = 0; i < n; i++) { | |
int k = Integer.parseInt(br.readLine()); | |
arr.add(k); | |
} | |
Collections.sort(arr); | |
for(int i = 0; i < n; i++) | |
System.out.println(arr.get(i)); | |
bw.flush(); | |
bw.close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment