public class Test {
 public static void sort(int[] array){
  int temp=0; 
  for(int i=0;i<array.length;i++){  
   for(int j=0;j<array.length;j++){
    if(array[i]<array[j]){
     temp = array[i];
     array[i] = array[j];
     array[j] = temp;
    }
    System.out.println("高手冒  "+array[j]+" 次泡");    
   }   
  }  
 }
 public static void main(String[] args){
  int[] array = {4,7,2,6,8,1,5,9,3};
  sort(array);
 } 
}

打印结果:

 

posted on 2012-03-30 15:49  鳄鱼。。。  阅读(160)  评论(0)    收藏  举报