-
Title Description:
-
Sorts and outputs the n number of inputs.
-
Input:
-
The first line of input includes an integer n (1<=n<=100).
The next line consists of n integers.
-
Output:
-
There may be multiple sets of test data, and for each set of data, the sorted n integers are output, followed by a space after each number.
The result of each set of test data is one row.
-
Sample input:
-
41 4 3 2
-
Sample output:
-
1 Importjava.util.Arrays;2 ImportJava.util.Scanner;3 4 Public classmain{5 Public Static voidMain (String[]args) {6Scanner in=NewScanner (system.in);7 while(In.hasnext ()) {8 intn=in.nextint ();9 int[]a=New int[n];Ten for(inti=0;i<n;i++){ Onea[i]=in.nextint (); A } - Arrays.sort (a); - for(inti=0;i<n;i++){ theSystem.out.print (a[i]+ ""); - } - System.out.println (); - } + } - } + /************************************************************** A problem:1202 at user:0000h - Language:java - result:accepted - time:940 Ms - memory:82892 KB - ****************************************************************/
Topic 1202: Sorting