diff --git a/codes/123456/.keep b/codes/123456/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/codes/123456/10044159.java b/codes/123456/10044159.java new file mode 100644 index 0000000000000000000000000000000000000000..a68f44407624d24174a52b37d3ac1b45ce388c28 --- /dev/null +++ b/codes/123456/10044159.java @@ -0,0 +1,17 @@ +/** + * 冒泡 排序 函数 + * aa bb cc + * @param a 待排序的数组 + * @param n 待排序的数组长度 + */ +public static void bubbleSort(int [] a, int n){ + // 你的代码,使无序数组 a 变得有序 + for (int i = 0; i < n; i++) { + for (int j = 0; j < i; j++) { + if (a[i] < a[j]) { + int t = a[i]; + a[i] = a[j]; + a[j] = t; + } + } + } \ No newline at end of file