package tree1;

import java.util.*;

public class bt {

public static int []a={1,5,7,0,9,2,4,377,91,12};

public static void main(String[]args)

{

bubble(10);

System.out.println("input the data:");

for(int i=0;i<10;i++)

System.out.print(a[i]+" ");

}

public static void bubble(int n)

{

int i,j;

int temp;

for(i=0;i<n-1;i++)//n个数比较n趟

for(j=i+1;j<n;j++)

{

if(a[i]<a[j])

{

temp=a[i];

a[i]=a[j];//a[i]为每次比较后的最小的数字

a[j]=temp;

}

}

}


}