ASCII code sorting time limit: ms | Memory limit:65535 KB Difficulty:2 description after entering three characters (which can be repeated), the ASCII code of each character is printed in the order of three characters from small to large. Enter the first line to enter a number n, indicating 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, output one line, the middle of the character separated by a space. Sample input 2QWEASD sample output e q WA d s
Package ACM1; //In the submission of the question, note that this place to delete the import java.util.arrays;import java.util.Scanner; Public classNYOJW2 //Submit the name of the class changed to main{ Public Static voidMain (String[]args) {intn,i,j; Scanner Scanner=NewScanner (System.inch); N=Scanner.nextint (); for(j=0; j<n;j++) {String str=NewString (); Char[]ch =New Char[3]; STR=Scanner.next (); //Gets the input string for(i=0;i<3; i++) {Ch[i]=Str.charat (i); //Read the STR string into the ch[] array. CharAt (i) I represents the I-character of this string } arrays.sort (CH); System. out. println (ch[0]+" "+ch[1]+" "+ch[2]); } } }
ASCII-code Ordering