public static void main(String[] args) {
int[] list = {100, 22, 43, 12, 99, 234, 33, 76};
for(int i=0; i<list.length-1; i++){
for(int j=0; j<list.length-1-i; j++){
if(list[j] > list[j+1]){
int temp = list[j];
list[j] = list[j+1];
list[j+1] = temp;
}
}
}
冒泡排序
最新推荐文章于 2025-05-19 09:28:05 发布