From 2c23f674862f2414664adc64aa50c3f2a24be79c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E4=BF=8A=E4=BC=9F?= <2421084001@qq.com> Date: Tue, 29 Nov 2022 16:56:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=AC=AC=E4=BA=8C=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 --- ...14\346\254\241\344\275\234\344\270\232.md" | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 "12\345\217\267 \346\236\227\344\277\212\344\274\237/20221128 \347\254\254\344\272\214\346\254\241\344\275\234\344\270\232.md" diff --git "a/12\345\217\267 \346\236\227\344\277\212\344\274\237/20221128 \347\254\254\344\272\214\346\254\241\344\275\234\344\270\232.md" "b/12\345\217\267 \346\236\227\344\277\212\344\274\237/20221128 \347\254\254\344\272\214\346\254\241\344\275\234\344\270\232.md" new file mode 100644 index 0000000..0499995 --- /dev/null +++ "b/12\345\217\267 \346\236\227\344\277\212\344\274\237/20221128 \347\254\254\344\272\214\346\254\241\344\275\234\344\270\232.md" @@ -0,0 +1,37 @@ +### 第二次作业 + +~~~ java + + +import java.util.Scanner; + +public class zy2 { + public static void main(String[] args) { + System.out.println("请输入一个4位数"); + Scanner in=new Scanner(System.in); + int num= in.nextInt(); + int ge= num%10; + int shi=num/10%10; + int bai= num/100%10; + int qian=num/1000; + System.out.println("千位是"+qian+"百位是"+bai+"十位是"+shi+"个位是"+ge); + } +} +~~~ + +~~~ java +import java.util.Scanner; + +public class zy22 { + public static void main(String[] args) { + System.out.println("请输入温度"); + Scanner sc = new Scanner(System.in); + float a = sc.nextFloat(); + float b; + b=(a-32) * 5 / 9; + System.out.println(b); + } +} + +~~~ + -- Gitee From 2677dd67070fcef2b4023093bc24298c509170c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E4=BF=8A=E4=BC=9F?= <2421084001@qq.com> Date: Thu, 1 Dec 2022 21:11:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1130=E7=AC=AC=E4=B8=89=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 --- ...11\346\254\241\344\275\234\344\270\232.md" | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 "12\345\217\267 \346\236\227\344\277\212\344\274\237/20221130 \347\254\254\344\270\211\346\254\241\344\275\234\344\270\232.md" diff --git "a/12\345\217\267 \346\236\227\344\277\212\344\274\237/20221130 \347\254\254\344\270\211\346\254\241\344\275\234\344\270\232.md" "b/12\345\217\267 \346\236\227\344\277\212\344\274\237/20221130 \347\254\254\344\270\211\346\254\241\344\275\234\344\270\232.md" new file mode 100644 index 0000000..39666d2 --- /dev/null +++ "b/12\345\217\267 \346\236\227\344\277\212\344\274\237/20221130 \347\254\254\344\270\211\346\254\241\344\275\234\344\270\232.md" @@ -0,0 +1,101 @@ +## JAVA作业 3.4.5.6.7 足球 + +~~~ java +import java.util.Scanner; + +public class zy31 { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int x,y; + boolean result; + System.out.println("请输入第一个数"); + x =in.nextInt(); + System.out.println("请输入第二个数"); + y = in.nextInt(); + result =(( x + y ) % 3 == 0 ) || x == 3 || y==3; + System.out.println(result); + } +} + +第三题 +~~~ + +~~~ java +public class zy32 { + public static void main(String[] args) { + (定义父亲身高) + double b=177; + (定义母亲身高) + double m=165; + double s = ((b + m)*1.08/2); + double g = (b*0.923 + m)/2; + System.out.println("儿子身高"+s+"厘米"); + System.out.println("女儿身高"+g+"厘米"); + + } +} +第四题 +~~~ + +~~~ java +public class zy33 { + public static void main(String[] args) { + int hong = 21; + int lv =24; + hong = hong*2+3; + lv = 24*2; + System.out.println(hong==lv); + } +} +第五题 +~~~ + +~~~ java +public class zy34 { + public static void main(String[] args) { + double all = 24+8+3; + all =(all*0.8)>=30?all*0.8:all; + double all2 = 16+8+3; + double h=all y ? ++x : y++; + +z=12 z=11 3=11 4 x=y +第七题 +~~~ + +~~~java +import java.util.Scanner; + +public class zy35 { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + System.out.println("中国得分"); + int zg =sc.nextInt(); + System.out.println("日本得分"); + int rb =sc.nextInt(); + if (zg-rb==0){ + System.out.println("啊?"); + } else if (zg-rb==1) { + System.out.println("奖励海参一桶"); + } + } +} + +足球 +~~~ + -- Gitee