从小到大冒泡排序 注意数组的初始化方式
package org.xia;
public class Maopao {
public static void main(String[] args) {
int[] integ =new int[]{4,5,3,1,2,0,8,7,6};
for(int i=9; i>0; i--){
for(int j=0; j<8; j++){
if(integ[j]>integ[j+1]){
int tag = integ[j+1];
integ[j+1] = integ[j];
integ[j] = tag;
}
}
}
for(int i=0 ; i<9; i++){
System.out.println(integ[i]);
}
}
}