-
Title Description:
-
Sorts the number of n lengths up to 1000.
-
Input:
-
Enter the first behavior of an integer N, (1<=n<=100).
The next n rows have a number for each row, and the length of the number is 1<=len<=1000.
Each count is a positive number and is guaranteed to contain no prefix zeros.
-
Output:
-
There may be more than one set of test data, for each set of data, the number of n will be given to order from small to large, output sorted results, each of the number of rows.
-
Sample input:
-
311111111111111111111111111111222222222222222222222222222222222233333333
-
Sample output:
-
33333333111111111111111111111111111112222222222222222222222222222222222
1 ImportJava.math.BigInteger;2 Importjava.util.Arrays;3 ImportJava.util.Scanner;4 5 Public classmain{6 Public Static voidMain (String[]args) {7Scanner in=NewScanner (system.in);8 while(In.hasnext ()) {9 intn=in.nextint ();Ten in.nextline (); OneBiginteger[] X=NewBiginteger[n]; A for(inti=0;i<n;i++){ -String line=in.nextline (); -x[i]=NewBigInteger (string.valueof (line)); the } - arrays.sort (x); - for(inti=0;i<n;i++){ - System.out.println (X[i]); + } - } + } A } at - /************************************************************** - problem:1190 - user:0000h - Language:java - result:accepted in time:520 Ms - memory:40476 KB to ****************************************************************/
Topic 1190: Sorting large integers