From 878631d0783766f2d1138efb104538182c66920f Mon Sep 17 00:00:00 2001 From: yhgfhgfh <14250000+yhgfhgfh@user.noreply.gitee.com> Date: Mon, 1 Apr 2024 14:22:41 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20=20fasfac244?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codes/ fasfac244/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 codes/ fasfac244/.keep diff --git a/codes/ fasfac244/.keep b/codes/ fasfac244/.keep new file mode 100644 index 000000000..e69de29bb -- Gitee From 6826ddb855cdaf236d026bdbe1fb5b45152e09f3 Mon Sep 17 00:00:00 2001 From: yhgfhgfh <14250000+yhgfhgfh@user.noreply.gitee.com> Date: Mon, 1 Apr 2024 14:23:16 +0000 Subject: [PATCH 2/2] add codes/ fasfac244/15742842.java. Signed-off-by: yhgfhgfh <14250000+yhgfhgfh@user.noreply.gitee.com> --- codes/ fasfac244/15742842.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 codes/ fasfac244/15742842.java diff --git a/codes/ fasfac244/15742842.java b/codes/ fasfac244/15742842.java new file mode 100644 index 000000000..6e9861fa3 --- /dev/null +++ b/codes/ fasfac244/15742842.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