From 66f562039c1f5081fff1edcb2f0c095b8b89fe38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=BA=9A=E8=8C=B9?= <767985952@qq.com> Date: Fri, 16 Sep 2022 06:44:07 +0000 Subject: [PATCH 1/4] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20wang-yaru01?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codes/wang-yaru01/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 codes/wang-yaru01/.keep diff --git a/codes/wang-yaru01/.keep b/codes/wang-yaru01/.keep new file mode 100644 index 00000000..e69de29b -- Gitee From 5f6ab9d1ae58cf33cfc52f022f107146b82bed7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=BA=9A=E8=8C=B9?= <767985952@qq.com> Date: Fri, 16 Sep 2022 06:45:19 +0000 Subject: [PATCH 2/4] add codes/wang-yaru01/test.java. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王亚茹 <767985952@qq.com> --- codes/wang-yaru01/test.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 codes/wang-yaru01/test.java diff --git a/codes/wang-yaru01/test.java b/codes/wang-yaru01/test.java new file mode 100644 index 00000000..a62ff0bf --- /dev/null +++ b/codes/wang-yaru01/test.java @@ -0,0 +1,22 @@ +public static void main7(String[] args) { + int[] array = 10,5,3,7,6}; + myBubblesort(array); + System.out.println(Arrays.toString(array)); +} +public static void myBubblesort(int[] array){ + for (int i = 0; i < array.length-1; i++) { + boolean flg = false; + for (int j = 0; j < array.length-1-i; j++) { + if(array[j] > array[j+1]){ + int tmp = 0; + tmp = array[j]; + array[j] = array[j+1]; + array[j+1] = tmp; + flg = true; + } + } + if(flg == false){ + return; + } + } +} \ No newline at end of file -- Gitee From 7546386e96a669081e2e2e691b9effc696cb92fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=BA=9A=E8=8C=B9?= <767985952@qq.com> Date: Fri, 16 Sep 2022 06:47:51 +0000 Subject: [PATCH 3/4] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=20codes/wang-ya?= =?UTF-8?q?ru01/test.java=20=E4=B8=BA=20codes/wang-yaru01/I5RFOP.java?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codes/wang-yaru01/{test.java => I5RFOP.java} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename codes/wang-yaru01/{test.java => I5RFOP.java} (100%) diff --git a/codes/wang-yaru01/test.java b/codes/wang-yaru01/I5RFOP.java similarity index 100% rename from codes/wang-yaru01/test.java rename to codes/wang-yaru01/I5RFOP.java -- Gitee From a0a298aefdc949a85e59b0491f2162dc59590baa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=BA=9A=E8=8C=B9?= <767985952@qq.com> Date: Fri, 16 Sep 2022 06:51:59 +0000 Subject: [PATCH 4/4] update codes/wang-yaru01/I5RFOP.java. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王亚茹 <767985952@qq.com> --- codes/wang-yaru01/I5RFOP.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codes/wang-yaru01/I5RFOP.java b/codes/wang-yaru01/I5RFOP.java index a62ff0bf..55e6e71e 100644 --- a/codes/wang-yaru01/I5RFOP.java +++ b/codes/wang-yaru01/I5RFOP.java @@ -1,4 +1,4 @@ -public static void main7(String[] args) { +public static void main(String[] args) { int[] array = 10,5,3,7,6}; myBubblesort(array); System.out.println(Arrays.toString(array)); -- Gitee