From 9204aa7ae3d817036dcac70196ae9a6d97dab6fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=A1=E5=85=83=E5=AE=9D?= <14249222+no-ingots@user.noreply.gitee.com> Date: Mon, 1 Apr 2024 13:12:11 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20=20dfss412?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codes/ dfss412/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 codes/ dfss412/.keep diff --git a/codes/ dfss412/.keep b/codes/ dfss412/.keep new file mode 100644 index 00000000..e69de29b -- Gitee From 2e7a26fdd235a09152ed959b7989182a51310a99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=A1=E5=85=83=E5=AE=9D?= <14249222+no-ingots@user.noreply.gitee.com> Date: Mon, 1 Apr 2024 13:12:52 +0000 Subject: [PATCH 2/2] add codes/ dfss412/15742469.java. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 没元宝 <14249222+no-ingots@user.noreply.gitee.com> --- codes/ dfss412/15742469.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 codes/ dfss412/15742469.java diff --git a/codes/ dfss412/15742469.java b/codes/ dfss412/15742469.java new file mode 100644 index 00000000..6e9861fa --- /dev/null +++ b/codes/ dfss412/15742469.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