/**
* 冒泡排序
*/
public void codeGgt1(){
int[] a= {4,2,6,8,9,3,6,0};
for (int j=a.length;j>1;j--){
for(int i=0;i<a.length-1;i++){
if(a[i]>a[i+1]){
int temp=a[i];
a[i]=a[i+1];
a[i+1]=temp;
}
}
}
System.out.println(Arrays.toString(a));
for (int array:a){
System.out.println(array);
}
}
标签:自写,temp,int,System,冒泡排序,println
From: https://www.cnblogs.com/ggt-sxf/p/16810787.html