冒泡排序:
public static void main(String[] args) {
int[] nums = {10,9,88,12,7,76,34,57,109};
for (int j = 0; j < nums.length; j++) {
for (int i = 0; i < nums.length-1; i++) {
//相邻之间比较
if (nums[i]<nums[i+1]) {
int x = nums[i];
nums[i] = nums[i+1];
nums[i+1] = x;
}
}
}
//遍历输出
for (int i : nums) {
System.out.print(i+",");
}
}
}