JAVA的数组排序 public class mppx{ public static void main(String[] args) { int[] a= {5,2,9,6,1}; System.out.print("排序前,数组为:"); for(int i=0;i a[i+1]) { int temp=a[i]; a[i]=a[i+1]; a[i+1]=temp; } } } System.out.print("排序
public class mppx{ public static void main(String[] args) { int[] a= {5,2,9,6,1}; System.out.print("排序前,数组为:"); for(int i=0;i a[i+1]) { int temp=a[i]; a[i]=a[i+1]; a[i+1]=temp; } } } System.out.print("排序后,数组为:"); for(int i=0;i