Skip to content

Instantly share code, notes, and snippets.

@mym0404
Created May 31, 2022 03:43
Show Gist options
  • Save mym0404/7d263bc48f3726f07ea3475ad8c77f04 to your computer and use it in GitHub Desktop.
Save mym0404/7d263bc48f3726f07ea3475ad8c77f04 to your computer and use it in GitHub Desktop.
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));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
int n = Integer.parseInt(br.readLine());
int[] arr = new int[n];
for(int i = 0; i < n; i++)
arr[i] = Integer.parseInt(br.readLine());
Arrays.sort(arr);
for(int i = 0; i< n; i++)
bw.write(arr[i] + "\n");
bw.flush();
bw.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment