📅  最后修改于: 2022-03-11 14:52:06.360000             🧑  作者: Mango
int a[] = {5,3,2,7,10,1};
for (int x = 0; x < a.length; x++) {
for (int i = 0; i < a.length-x-1; i++) {
if(a[i] < a[i+1]){
int tmp = a[i+1];
a[i+1] = a[i];
a[i] = tmp;
}
}
}