-------------------------------------------
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 x[]=new int[3]; 11 for(int i=0;i<x.length;i++){ 12 x[i]=sc.nextInt(); 13 } 14 15 Arrays.sort(x); 16 17 for(int i=0;i<x.length;i++){ 18 System.out.print(x[i]+" "); 19 } 20 21 } 22 23 }