求一个数组由大到小排序
/**
* @Description: 求一个数组由大到小排序
*/
public static void sort(int b[]) {
for(int i = 0; i < b.length; i++){
for(int j = i + 1; j < b.length; j++){
if(b[i] < b[j]){
int temp = b[i];
b[i] = b[j];
b[j] = temp;
}
}
for(int k = 0; k < b.length; k++){
System.out.print(b[k] + " ");
}
System.out.println();
}
}