NYOJ之ASCII码排序
-------------------------------------------------------------
AC代码:
1 import java.util.Arrays; 2 import java.util.Scanner; 3 4 public class Main { 5 6 public static void main(String[] args) { 7 8 Scanner sc=new Scanner(System.in); 9 10 int n=Integer.parseInt(sc.nextLine()); 11 12 while(n-->0){ 13 14 String s=sc.nextLine(); 15 16 char[] book=s.toCharArray(); 17 Arrays.sort(book); 18 19 for(int i=0;i<book.length;i++){ 20 System.out.printf("%c ",book[i]); 21 } 22 System.out.println(); 23 } 24 25 } 26 27 }