From ac7a2defd24ce92f46ff7218dd21ff9321344b02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E9=93=96=E6=B5=A9?= <1136734375@qq.com> Date: Thu, 1 Dec 2022 14:30:04 +0000 Subject: [PATCH 01/10] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=2005=E8=B0=A2?= =?UTF-8?q?=E9=93=96=E6=B5=A9=20=E4=B8=BA=2005=20=E8=B0=A2=E9=93=96?= =?UTF-8?q?=E6=B5=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../1126 \350\260\242\351\223\226\346\265\251.md" | 0 .../20221129 \350\260\242\351\223\226\346\265\251.md" | 0 .../2022121\350\260\242\351\223\226\346\265\251.md" | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename "05\350\260\242\351\223\226\346\265\251/1126 \350\260\242\351\223\226\346\265\251.md" => "05 \350\260\242\351\223\226\346\265\251/1126 \350\260\242\351\223\226\346\265\251.md" (100%) rename "05\350\260\242\351\223\226\346\265\251/20221129 \350\260\242\351\223\226\346\265\251.md" => "05 \350\260\242\351\223\226\346\265\251/20221129 \350\260\242\351\223\226\346\265\251.md" (100%) rename "05\350\260\242\351\223\226\346\265\251/2022121\350\260\242\351\223\226\346\265\251.md" => "05 \350\260\242\351\223\226\346\265\251/2022121\350\260\242\351\223\226\346\265\251.md" (100%) diff --git "a/05\350\260\242\351\223\226\346\265\251/1126 \350\260\242\351\223\226\346\265\251.md" "b/05 \350\260\242\351\223\226\346\265\251/1126 \350\260\242\351\223\226\346\265\251.md" similarity index 100% rename from "05\350\260\242\351\223\226\346\265\251/1126 \350\260\242\351\223\226\346\265\251.md" rename to "05 \350\260\242\351\223\226\346\265\251/1126 \350\260\242\351\223\226\346\265\251.md" diff --git "a/05\350\260\242\351\223\226\346\265\251/20221129 \350\260\242\351\223\226\346\265\251.md" "b/05 \350\260\242\351\223\226\346\265\251/20221129 \350\260\242\351\223\226\346\265\251.md" similarity index 100% rename from "05\350\260\242\351\223\226\346\265\251/20221129 \350\260\242\351\223\226\346\265\251.md" rename to "05 \350\260\242\351\223\226\346\265\251/20221129 \350\260\242\351\223\226\346\265\251.md" diff --git "a/05\350\260\242\351\223\226\346\265\251/2022121\350\260\242\351\223\226\346\265\251.md" "b/05 \350\260\242\351\223\226\346\265\251/2022121\350\260\242\351\223\226\346\265\251.md" similarity index 100% rename from "05\350\260\242\351\223\226\346\265\251/2022121\350\260\242\351\223\226\346\265\251.md" rename to "05 \350\260\242\351\223\226\346\265\251/2022121\350\260\242\351\223\226\346\265\251.md" -- Gitee From 0997cf8ad2b3302581b689d76a10f92901ce3d77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E9=93=96=E6=B5=A9?= <1136734375@qq.com> Date: Sat, 3 Dec 2022 11:01:26 +0800 Subject: [PATCH 02/10] =?UTF-8?q?2022122=20=E8=B0=A2=E9=93=96=E6=B5=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2022122.md" | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 "05\350\260\242\351\223\226\346\265\251/2022122.md" diff --git "a/05\350\260\242\351\223\226\346\265\251/2022122.md" "b/05\350\260\242\351\223\226\346\265\251/2022122.md" new file mode 100644 index 0000000..f08f6ae --- /dev/null +++ "b/05\350\260\242\351\223\226\346\265\251/2022122.md" @@ -0,0 +1,121 @@ +```java +import java.util.Scanner; + +public class dd1 { + public static void main(String[] args) { + Scanner sc=new Scanner(System.in); + System.out.println("请输入车型"); + String cx= sc.next(); + Scanner km=new Scanner(System.in); + System.out.println("请输入公里"); + int gl= km.nextInt(); + if (gl>3) { + switch (cx) { + case "夏利": + System.out.println((gl - 3) * 2.1 + 3); + break; + case "富康": + System.out.println((gl - 3) * 2.4 + 3); + break; + case "桑塔纳": + System.out.println((gl - 3) * 2.7 + 3); + break; + } + } + else { + switch (cx){ + case"夏利": + System.out.println("3元"); + break; + case"富康": + System.out.println("4元"); + break; + case"桑塔纳": + System.out.println("5元"); + break; + } + } + } +} +``` + +```java +import java.util.Scanner; + +public class DD2 { + public static void main(String[] args) { + Scanner a=new Scanner(System.in); + System.out.println("请输入年"); + int nian=a.nextInt(); + Scanner b=new Scanner(System.in); + System.out.println("请输入月"); + int yue=b.nextInt(); + Scanner c=new Scanner(System.in); + System.out.println("请输入日"); + int ri=a.nextInt(); + int ey; + if(nian % 4==0 &&nian %100!=0||nian%400==0){ + ey=29; + }else ey=28; + + switch (yue){ + case 1: + System.out.println(ri); + break; + case 2: + System.out.println(ri+31); + break; + case 3: + System.out.println(ri+ey+31); + break; + case 4: + System.out.println(ri+ey+31*2); + break; + case 5: + System.out.println(ri+ey+31*2+30); + break; + case 6: + System.out.println(ri+ey+31*3+30); + break; + case 7: + System.out.println(ri+ey+31*3+30*2); + break; + case 8: + System.out.println(ri+ey+31*4+30*2); + break; + case 9: + System.out.println(ri+ey+31*5+30*2); + break; + case 10: + System.out.println(ri+ey+31*5+30*3); + break; + case 11: + System.out.println(ri+ey+31*6+30*3); + break; + case 12: + System.out.println(ri+ey+31*6+30*4); + break; + } + } + +} +``` + +三元运算符 + +~~~java +int a = 10; +int b = 20; +int c = a > b ? a : b; // 判断 a>b 是否为真,如果为真取a的值,如果为假,取b的值 +先执行关系表达式 看结果 是不是执行 如果执行 就执行关系表达式1 否则执行表达式2 +~~~ + +if语句 + +~~~java +格式1: +if (关系表达式) { + 语句体; +} +首先计算关系表达式的值 如果关系表达式的值为true就执行语句体 如果关系表达式的值为false就不执行语句体 继续执行后面的语句内容 +~~~ \ No newline at end of file -- Gitee From ed0c62ebca2fcf7e03751801c919f20bd20558b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E9=93=96=E6=B5=A9?= <1136734375@qq.com> Date: Sat, 3 Dec 2022 11:08:37 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E7=AC=AC=E5=9B=9B=E6=AC=A1=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20221202 if\345\222\214switch.md" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "05 \350\260\242\351\223\226\346\265\251/2022122.md" => "05 \350\260\242\351\223\226\346\265\251/20221202 if\345\222\214switch.md" (100%) diff --git "a/05 \350\260\242\351\223\226\346\265\251/2022122.md" "b/05 \350\260\242\351\223\226\346\265\251/20221202 if\345\222\214switch.md" similarity index 100% rename from "05 \350\260\242\351\223\226\346\265\251/2022122.md" rename to "05 \350\260\242\351\223\226\346\265\251/20221202 if\345\222\214switch.md" -- Gitee From cf0d9ea6e8a797f77a6d11f195c8b73427d6d9f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E9=93=96=E6=B5=A9?= <1136734375@qq.com> Date: Sat, 3 Dec 2022 03:23:07 +0000 Subject: [PATCH 04/10] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=2005=20?= =?UTF-8?q?=E8=B0=A2=E9=93=96=E6=B5=A9/2022122.md=20=E4=B8=BA=2005=20?= =?UTF-8?q?=E8=B0=A2=E9=93=96=E6=B5=A9/2022122=E8=B0=A2=E9=93=96=E6=B5=A9.?= =?UTF-8?q?md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2022122\350\260\242\351\223\226\346\265\251.md" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "05 \350\260\242\351\223\226\346\265\251/2022122.md" => "05 \350\260\242\351\223\226\346\265\251/2022122\350\260\242\351\223\226\346\265\251.md" (100%) diff --git "a/05 \350\260\242\351\223\226\346\265\251/2022122.md" "b/05 \350\260\242\351\223\226\346\265\251/2022122\350\260\242\351\223\226\346\265\251.md" similarity index 100% rename from "05 \350\260\242\351\223\226\346\265\251/2022122.md" rename to "05 \350\260\242\351\223\226\346\265\251/2022122\350\260\242\351\223\226\346\265\251.md" -- Gitee From d9ed860820bdddeba37b7c9707a0b8a587a89e91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E9=93=96=E6=B5=A9?= <1136734375@qq.com> Date: Sat, 3 Dec 2022 03:28:24 +0000 Subject: [PATCH 05/10] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=2005?= =?UTF-8?q?=20=E8=B0=A2=E9=93=96=E6=B5=A9/2022122=E8=B0=A2=E9=93=96?= =?UTF-8?q?=E6=B5=A9.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...22\350\260\242\351\223\226\346\265\251.md" | 121 ------------------ 1 file changed, 121 deletions(-) delete mode 100644 "05 \350\260\242\351\223\226\346\265\251/2022122\350\260\242\351\223\226\346\265\251.md" diff --git "a/05 \350\260\242\351\223\226\346\265\251/2022122\350\260\242\351\223\226\346\265\251.md" "b/05 \350\260\242\351\223\226\346\265\251/2022122\350\260\242\351\223\226\346\265\251.md" deleted file mode 100644 index f08f6ae..0000000 --- "a/05 \350\260\242\351\223\226\346\265\251/2022122\350\260\242\351\223\226\346\265\251.md" +++ /dev/null @@ -1,121 +0,0 @@ -```java -import java.util.Scanner; - -public class dd1 { - public static void main(String[] args) { - Scanner sc=new Scanner(System.in); - System.out.println("请输入车型"); - String cx= sc.next(); - Scanner km=new Scanner(System.in); - System.out.println("请输入公里"); - int gl= km.nextInt(); - if (gl>3) { - switch (cx) { - case "夏利": - System.out.println((gl - 3) * 2.1 + 3); - break; - case "富康": - System.out.println((gl - 3) * 2.4 + 3); - break; - case "桑塔纳": - System.out.println((gl - 3) * 2.7 + 3); - break; - } - } - else { - switch (cx){ - case"夏利": - System.out.println("3元"); - break; - case"富康": - System.out.println("4元"); - break; - case"桑塔纳": - System.out.println("5元"); - break; - } - } - } -} -``` - -```java -import java.util.Scanner; - -public class DD2 { - public static void main(String[] args) { - Scanner a=new Scanner(System.in); - System.out.println("请输入年"); - int nian=a.nextInt(); - Scanner b=new Scanner(System.in); - System.out.println("请输入月"); - int yue=b.nextInt(); - Scanner c=new Scanner(System.in); - System.out.println("请输入日"); - int ri=a.nextInt(); - int ey; - if(nian % 4==0 &&nian %100!=0||nian%400==0){ - ey=29; - }else ey=28; - - switch (yue){ - case 1: - System.out.println(ri); - break; - case 2: - System.out.println(ri+31); - break; - case 3: - System.out.println(ri+ey+31); - break; - case 4: - System.out.println(ri+ey+31*2); - break; - case 5: - System.out.println(ri+ey+31*2+30); - break; - case 6: - System.out.println(ri+ey+31*3+30); - break; - case 7: - System.out.println(ri+ey+31*3+30*2); - break; - case 8: - System.out.println(ri+ey+31*4+30*2); - break; - case 9: - System.out.println(ri+ey+31*5+30*2); - break; - case 10: - System.out.println(ri+ey+31*5+30*3); - break; - case 11: - System.out.println(ri+ey+31*6+30*3); - break; - case 12: - System.out.println(ri+ey+31*6+30*4); - break; - } - } - -} -``` - -三元运算符 - -~~~java -int a = 10; -int b = 20; -int c = a > b ? a : b; // 判断 a>b 是否为真,如果为真取a的值,如果为假,取b的值 -先执行关系表达式 看结果 是不是执行 如果执行 就执行关系表达式1 否则执行表达式2 -~~~ - -if语句 - -~~~java -格式1: -if (关系表达式) { - 语句体; -} -首先计算关系表达式的值 如果关系表达式的值为true就执行语句体 如果关系表达式的值为false就不执行语句体 继续执行后面的语句内容 -~~~ \ No newline at end of file -- Gitee From 9ce1774f501b9ffa8b53b4ca67172d58115b470b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E9=93=96=E6=B5=A9?= <1136734375@qq.com> Date: Sun, 4 Dec 2022 22:18:57 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E7=AC=AC=E4=BA=94=E6=AC=A1=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...if\345\222\214\345\276\252\347\216\257.md" | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 "05 \350\260\242\351\223\226\346\265\251/2022124 if\345\222\214\345\276\252\347\216\257.md" diff --git "a/05 \350\260\242\351\223\226\346\265\251/2022124 if\345\222\214\345\276\252\347\216\257.md" "b/05 \350\260\242\351\223\226\346\265\251/2022124 if\345\222\214\345\276\252\347\216\257.md" new file mode 100644 index 0000000..92abb24 --- /dev/null +++ "b/05 \350\260\242\351\223\226\346\265\251/2022124 if\345\222\214\345\276\252\347\216\257.md" @@ -0,0 +1,63 @@ +```java +import java.util.Scanner; + +public class D10 { + public static void main(String[] args) { + //2.用户分别输入数 a,数b,让程序实现从a 开始循环到b. + // 输出"有生之年,能看到中国队出线吗?" + int a,b,i; + Scanner sc=new Scanner(System.in); + System.out.println("输出a的数"); + a= sc.nextInt(); + System.out.println("输出b的数"); + b= sc.nextInt(); + if (a>b){ + for (i=0;i Date: Mon, 5 Dec 2022 22:16:35 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E7=AC=AC=E5=85=AD=E6=AC=A1=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2022125.md" | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 "05 \350\260\242\351\223\226\346\265\251/2022125.md" diff --git "a/05 \350\260\242\351\223\226\346\265\251/2022125.md" "b/05 \350\260\242\351\223\226\346\265\251/2022125.md" new file mode 100644 index 0000000..6e14755 --- /dev/null +++ "b/05 \350\260\242\351\223\226\346\265\251/2022125.md" @@ -0,0 +1,54 @@ +```java +public class d12 { + public static void main(String[] args) { + //求555 555的约数中最大的三位数 + int i; + int a=555555; + int da=0; + for (i=100;i<=999;i++){ + if (555555%i==0){ + da=i; + } + } + System.out.println(da); + } +} +``` + +```java +import java.util.Random; +import java.util.Scanner; + +public class d13 { + public static void main(String[] args) { + int num; + int shuru; + int count=0; + Random ran = new Random(); + num = ran.nextInt(100); + Scanner Sc = new Scanner(System.in); + while (true){ + System.out.println("请输入一个数"); + shuru = Sc.nextInt(); + if (shuru>num){ + System.out.println("你猜的数字太大了"); + } else if (shuru=2&&count<=6) { + System.out.println("你一点点聪明"); + }else{ + System.out.println("你真蠢"); + } + } +} +``` + +# 笔记: \ No newline at end of file -- Gitee From 2c47f9f270129686ed6a9c6a794cfb16b8c3e63c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E9=93=96=E6=B5=A9?= <1136734375@qq.com> Date: Thu, 8 Dec 2022 22:35:07 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E7=AC=AC=E5=85=AD=E6=AC=A1=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...52\347\216\257\346\225\260\347\273\204.md" | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 "05 \350\260\242\351\223\226\346\265\251/20221208 \345\276\252\347\216\257\346\225\260\347\273\204.md" diff --git "a/05 \350\260\242\351\223\226\346\265\251/20221208 \345\276\252\347\216\257\346\225\260\347\273\204.md" "b/05 \350\260\242\351\223\226\346\265\251/20221208 \345\276\252\347\216\257\346\225\260\347\273\204.md" new file mode 100644 index 0000000..e27c172 --- /dev/null +++ "b/05 \350\260\242\351\223\226\346\265\251/20221208 \345\276\252\347\216\257\346\225\260\347\273\204.md" @@ -0,0 +1,22 @@ +```java +import java.util.Scanner; + +public class D15 { + public static void main(String[] args) { + Scanner sc=new Scanner(System.in); + + + int[]scores=new int[5]; + + for( int i=0;i<5;i++){ + System.out.println("输入一个数值"); + scores[i]= sc.nextInt(); + } + + + for(int b=0;b<5;b++){ + System.out.println(" "+scores[b]); + } + } +} +``` \ No newline at end of file -- Gitee From 5c9e1877b7d6472b6dfbee58074658aed5c97a95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E9=93=96=E6=B5=A9?= <1136734375@qq.com> Date: Mon, 19 Dec 2022 12:56:58 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E7=AC=AC=E5=85=AB=E6=AC=A1=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20221219\345\207\275\346\225\260.md" | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 "05 \350\260\242\351\223\226\346\265\251/20221219\345\207\275\346\225\260.md" diff --git "a/05 \350\260\242\351\223\226\346\265\251/20221219\345\207\275\346\225\260.md" "b/05 \350\260\242\351\223\226\346\265\251/20221219\345\207\275\346\225\260.md" new file mode 100644 index 0000000..c9bd97b --- /dev/null +++ "b/05 \350\260\242\351\223\226\346\265\251/20221219\345\207\275\346\225\260.md" @@ -0,0 +1,49 @@ +~~~java +import java.util.Scanner; + +public class D777 { + public static void main(String[] args) { + Scanner d1 =new Scanner(System.in); + System.out.println("请输入数据"); + int a1= d1.nextInt(); + System.out.println("请输入数据"); + int a2= d1.nextInt(); + int max=max(a1,a2); + System.out.println("最大值为"+max); + } + public static int max(int a1, int a2) { + if(a1>a2) + return a1; + else + return a2; + + } + +} +~~~ + +~~~jav +import java.util.Scanner; + +public class D777 { + public static void main(String[] args) { + Scanner d1 =new Scanner(System.in); + System.out.println("请输入数据"); + int x= d1.nextInt(); + System.out.println("请输入数据"); + int y= d1.nextInt(); + System.out.println("请输入数据"); + int z= d1.nextInt(); + int sum=sum(x,y,z); + System.out.println("三个数的立方是"+ sum); + } + public static int sum(int x, int y,int z) { + int sum=x*x*x+y*y*y+z*z*z; + return sum; + + + } + +} +~~~ + -- Gitee From 50883facad50537781c51f9c920bf9f4edf0094d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E9=93=96=E6=B5=A9?= <1136734375@qq.com> Date: Tue, 20 Dec 2022 23:52:22 +0800 Subject: [PATCH 10/10] =?UTF-8?q?20221220=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20221220.md" | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 "05 \350\260\242\351\223\226\346\265\251/20221220.md" diff --git "a/05 \350\260\242\351\223\226\346\265\251/20221220.md" "b/05 \350\260\242\351\223\226\346\265\251/20221220.md" new file mode 100644 index 0000000..24ecafd --- /dev/null +++ "b/05 \350\260\242\351\223\226\346\265\251/20221220.md" @@ -0,0 +1,152 @@ +import java.util.Scanner; +7 + +8 +public class gu { +9 + public static void main(String[] args) { +10 + Scanner sc = new Scanner(System.in); +11 + System.out.println("输入⚪的半径"); +12 + ad(sc.nextDouble(),3.14); +13 + } +14 + public static void ad(double a, double b){ +15 + System.out.println("半径是"+2*b*a); +16 + System.out.println("面积是"+b*a*a); +17 + } +18 + +19 +} +20 +``` +21 + +22 + 在主函数中产生20个0-10之间的随机数,将这20个随机数存入数组,并通过函数计算某个数在这些随机数中出现的次数(这“某个数”是在主函数中由用户输入的) +23 + +24 +```java +25 +import java.util.Arrays; +26 +import java.util.Scanner; +27 + +28 +public class shuzu { +29 + public static void main(String[] args) { +30 + long[] num = new long[10]; +31 + for (int i = 0; i < 20; i++) { +32 + num[i] = Math.round(Math.random() * 10); +33 + } +34 + Scanner sc = new Scanner(System.in); +35 + System.out.println("输入一个数"); +36 + long A = sc.nextLong(); +37 + af(num, A); +38 + } +39 + +40 + public static void af(long[] num, long A) { +41 + int count = 0; +42 + for (int i=0;i< num.length;i++){ +43 + if (A==num[i]){ +44 + count++; +45 + } +46 + } +47 + System.out.println(Arrays.toString(num)); +48 + System.out.println("次数是"+count); +49 + } +50 +} +51 +``` +52 + +53 +在主函数中接收10个数存入数组,在自定义函数中,将该数组中的最大值与第一个元素交换,最小值与最后一个元素交换,然后在主函数中输出交换后的数组 +54 + +55 +```java +56 +import java.util.Arrays; +57 + +58 +public class dfas { +59 + public static void main(String[] args) { +60 + int ac[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; +61 + System.out.println(Arrays.toString(ac)); +62 + add(ac); +63 + +64 + } +65 + +66 + public static void add(int brr[]) { +67 + int max = brr[0]; +68 + int x = brr[0]; +69 + +70 + for (int i = 0; i < brr.length; i++) { +71 + if (brr[i] > max) { +72 + max = brr[i]; +73 + } +74 + } +75 + for (int i=0;i< brr.length;i++){ +76 + if (brr[i]==max){ +77 + brr[i]=x; +78 + } +79 + } +80 + brr[0]=max; +81 + System.out.print("["); +8 \ No newline at end of file -- Gitee