From 8e381737fd9b7e86603f9cadc616f552b1691cba Mon Sep 17 00:00:00 2001 From: lizhao1688 <2953309156@qq.com> Date: Tue, 11 Feb 2025 02:38:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codes/19473105.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 codes/19473105.java diff --git a/codes/19473105.java b/codes/19473105.java new file mode 100644 index 00000000..c04f3701 --- /dev/null +++ b/codes/19473105.java @@ -0,0 +1,12 @@ +/** + * 冒泡排序函数 + * aa bb cc + * @param a 待排序的数组 + * @param n 待排序的数组长度 + */ +public static void bubbleSort(int [] a, int n){ + // 你的代码,使无序数组 a 变得有序 + ... + ... + +} //end -- Gitee From c99a79ac5cf25de471afda9656074d8e7248e4b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9A=94=E5=A3=81=E8=80=81=E7=8C=AB?= <2953309156@qq.com> Date: Mon, 10 Feb 2025 18:43:53 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20code?= =?UTF-8?q?s/19473105.java?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codes/19473105.java | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 codes/19473105.java diff --git a/codes/19473105.java b/codes/19473105.java deleted file mode 100644 index c04f3701..00000000 --- a/codes/19473105.java +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 冒泡排序函数 - * aa bb cc - * @param a 待排序的数组 - * @param n 待排序的数组长度 - */ -public static void bubbleSort(int [] a, int n){ - // 你的代码,使无序数组 a 变得有序 - ... - ... - -} //end -- Gitee From dd0f9795f96747dd99bb45dc50f052a4a494e3f4 Mon Sep 17 00:00:00 2001 From: lizhao1688 <2953309156@qq.com> Date: Tue, 11 Feb 2025 02:45:43 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 19473105.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 19473105.java diff --git a/19473105.java b/19473105.java new file mode 100644 index 00000000..78d16b72 --- /dev/null +++ b/19473105.java @@ -0,0 +1,20 @@ +/** + * 冒泡排序函数 + * 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 < n - i - 1; ++j) { + if(a[j] > a[j + 1]) { + int tmp = a[j]; + a[j] = a[j + 1]; + a[j + 1] = tmp; + } + } + } +} //end + + -- Gitee