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 1/9] =?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 2/9] =?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 3/9] =?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 4/9] =?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 5/9] =?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 6/9] =?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 7/9] =?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 8/9] =?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 9/9] =?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