-
Python 的冒泡算法答案
2020-07-24 10:56public static int[] maopao(int[] shuzu) {
for (int i = 0; i < shuzu.length; i++) { for (int j = 0; j < shuzu.length - 1; j++) { if (shuzu[j] > shuzu[j + 1]) { int temp = shuzu[j]; shuzu[j] = shuzu[j + 1]; shuzu[j + 1] = temp; } } } return shuzu; }