import java.util.Scanner; public class code1 { public static void main(String[] args) { int a[]=new int[10]; int temp; Scanner in = new Scanner(System.in); for(int i=1;i<=a.length;i++){ System.out.println("请输入第"+i+"个数的值"); a[i-1]=in.nextInt(); } /*for (int i = 0; i < a.length - 1; i++) { for (int j = 0; j < a.length-1; j++) { if (a[j] > a[j + 1]) { temp = a[j + 1]; a[j + 1] = a[j]; a[j] = temp; } } }*/ for (int i = 0; i < a.length - 1; i++) { for (int j = i + 1; j < a.length; j++) { if (a[i] > a[j]) { temp = a[j]; a[j] = a[i]; a[i] = temp; } } } for(int i=0;i