java冒泡排序
public class Main {
public static void main(String[] args) {
int[] arr = {12, 4, 24, 11, 32, 1, 312};
int temp, j, i;
for (j = 0; j < arr.length - 1; j++) {
for (i = 0; i < arr.length - 1 - j; i++) {
if (arr[i] > arr[i + 1]) {
temp = arr[i];
arr[i] = arr[i + 1];
arr[i + 1] = temp;
}
}
}
}
}