From 9a6753940115b97808630f95fae4e82a79dd85e2 Mon Sep 17 00:00:00 2001 From: asfasfchh <14249966+asfasfchh@user.noreply.gitee.com> Date: Mon, 1 Apr 2024 14:17:34 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20=20fasfcc223?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codes/ fasfcc223/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 codes/ fasfcc223/.keep diff --git a/codes/ fasfcc223/.keep b/codes/ fasfcc223/.keep new file mode 100644 index 000000000..e69de29bb -- Gitee From 8628b46c2d5a5b257fef20a6aa1eabf5a1d85e8a Mon Sep 17 00:00:00 2001 From: asfasfchh <14249966+asfasfchh@user.noreply.gitee.com> Date: Mon, 1 Apr 2024 14:18:00 +0000 Subject: [PATCH 2/2] add codes/ fasfcc223/15742831.java. Signed-off-by: asfasfchh <14249966+asfasfchh@user.noreply.gitee.com> --- codes/ fasfcc223/15742831.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 codes/ fasfcc223/15742831.java diff --git a/codes/ fasfcc223/15742831.java b/codes/ fasfcc223/15742831.java new file mode 100644 index 000000000..6e9861fa3 --- /dev/null +++ b/codes/ fasfcc223/15742831.java @@ -0,0 +1,19 @@ +/** + * 冒泡排序函数 + * aa bb cc + * @param a 待排序的数组 + * @param n 待排序的数组长度 + */ +public static void bubbleSort(int [] a, int n){ + // 你的代码,使无序数组 a 变得有序 + for (int i = 0; i < n - 1; i++) { + for (int j = 0; j < n - i - 1; j++) { + if (a[j] > a[j + 1]) { + + int temp = a[j]; + a[j] = a[j + 1]; + a[j + 1] = temp; + } + } + } +} //end \ No newline at end of file -- Gitee