After describing the input three characters (which can be duplicated), the ASCII code of each character outputs the three characters in the order from small to large.
-
-
Input
-
-
the first line enters a number n, which indicates that there are n sets of test data. The next n rows enter multiple sets of data, each with a row of three characters and no spaces between them.
-
-
Output
-
-
for each set of input data, the output line is separated by a space between the characters.
-
-
Sample input
-
-
3qweasdzxc
-
-
Sample output
-
e q wa d SC x z
1 Importjava.util.Arrays;2 ImportJava.util.Scanner;3 4 Public classMain {5 Public Static voidMain (string[] args) {6 intT;7Scanner scanner=NewScanner (system.in);8 Chara[]=New Char[3];9 Tent=scanner.nextint (); One while(true){ A if(t==0) - Break; -t--; the -A=Scanner.next (). ToCharArray (); - Arrays.sort (a); - +System.out.println (a[0]+ "" +a[1]+ "" +a[2]); - } + } A}
Quick row of arrays in Java