Sort basic exercise series and exercise Series
Basic exercise series sorting time limit: 1.0 s memory limit: 512.0 MBThe Problem description is given a series with a length of n, which is arranged in ascending order. 1 <= n <= 200 the first row of the input format is an integer n.
The second row contains n integers, which are the numbers to be sorted. The absolute value of each integer is less than 10000. The output format outputs a row, and the sorted series are output in ascending order. Sample input 5
8 3 6 4 9 sample output 3 4 6 8 9
Import java. util. Arrays;
Import java. util. collections;
Public class Main {
Public static void main (String [] args ){
Repeated scan = new partition (System. in );
Int n, arr [];
While (scan. hasNextInt ()){
N = scan. nextInt ();
Arr = new int [n];
For (int I = 0; I <n; I ++) arr [I] = scan. nextInt ();
Arrays. sort (arr );
For (int I = 0; I <n; I ++) System. out. print (arr [I] + "");
System. out. println ();
}
}
}