📌  相关文章
📜  java ordenar los valores de un array de menor a mayor - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:06.360000             🧑  作者: Mango

代码示例1
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;
            }
        }
    }