n次交换,N*N次比较
int []m = new int[]{1,2,5,7,8,22,8,3,21,0,30,44,21,62,698,52};
int temp;
for(int i=0;i<m.length;i++)
{
for(int j=i+1;j<=m.length-1;j++){
if(m[i]<m[j]){
temp =m[i];
m[i]=m[j];
m[j] = temp;
}
}
}
int []m = new int[]{1,2,5,7,8,22,8,3,21,0,30,44,21,62,698,52};
int temp;
for(int i=0;i<m.length;i++)
{
for(int j=i+1;j<=m.length-1;j++){
if(m[i]<m[j]){
temp =m[i];
m[i]=m[j];
m[j] = temp;
}
}
}