From 2a4178169ba871e10bc9c1a17f82f172efe0de08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B0=B8=E6=B7=B3?= <2678158018@qq.com> Date: Thu, 15 Dec 2022 16:28:18 +0800 Subject: [PATCH 1/2] =?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 --- ...14\346\254\241\346\225\260\347\273\204.md" | 0 ...202212115 java\345\244\215\344\271\240.md" | 31 +++++++++++++++++++ .../20221215 java\345\244\215\344\271\240.md" | 0 3 files changed, 31 insertions(+) rename "18 \345\276\220\346\260\270\346\267\263/202212011 java\347\254\254\344\272\214\346\254\241\346\225\260\347\273\204.md" => "18 \345\276\220\346\260\270\346\267\263/20221211 java\347\254\254\344\272\214\346\254\241\346\225\260\347\273\204.md" (100%) create mode 100644 "18 \345\276\220\346\260\270\346\267\263/202212115 java\345\244\215\344\271\240.md" create mode 100644 "18 \345\276\220\346\260\270\346\267\263/20221215 java\345\244\215\344\271\240.md" diff --git "a/18 \345\276\220\346\260\270\346\267\263/202212011 java\347\254\254\344\272\214\346\254\241\346\225\260\347\273\204.md" "b/18 \345\276\220\346\260\270\346\267\263/20221211 java\347\254\254\344\272\214\346\254\241\346\225\260\347\273\204.md" similarity index 100% rename from "18 \345\276\220\346\260\270\346\267\263/202212011 java\347\254\254\344\272\214\346\254\241\346\225\260\347\273\204.md" rename to "18 \345\276\220\346\260\270\346\267\263/20221211 java\347\254\254\344\272\214\346\254\241\346\225\260\347\273\204.md" diff --git "a/18 \345\276\220\346\260\270\346\267\263/202212115 java\345\244\215\344\271\240.md" "b/18 \345\276\220\346\260\270\346\267\263/202212115 java\345\244\215\344\271\240.md" new file mode 100644 index 0000000..8eaa9f2 --- /dev/null +++ "b/18 \345\276\220\346\260\270\346\267\263/202212115 java\345\244\215\344\271\240.md" @@ -0,0 +1,31 @@ +作业 + +输入倒叙乘法口诀表 + +```java +public class aasd { + public static void main(String[] args) { + for (int i = 9; i >=1 ; i--) { + for (int j = i; j >=1; j--) { + System.out.print( i+ "*" +j + "=" + i * j + "\t"); + } + System.out.println(); + } + } +} +``` + +100立方燃气 第二阶梯240~360 4.05元 第三阶梯360~999999 5.06元 求第二阶梯和第三阶梯分别所占的燃气 + +```java +public class fgdg { + public static void main(String[] args) { + for (int x=1;x<=100;x++){ + if (x*4.05+(100-x)*5.06==445.4){ + System.out.println(x+"立方"); + System.out.println((100-x)+"立方"); + } + } + } +} +``` \ No newline at end of file diff --git "a/18 \345\276\220\346\260\270\346\267\263/20221215 java\345\244\215\344\271\240.md" "b/18 \345\276\220\346\260\270\346\267\263/20221215 java\345\244\215\344\271\240.md" new file mode 100644 index 0000000..e69de29 -- Gitee From ccfc04ff8594a0fec7f281f3a53c8b45d92fff9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B0=B8=E6=B7=B3?= <2678158018@qq.com> Date: Sun, 18 Dec 2022 14:55:27 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=AC=AC=E4=B9=9D=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 --- ...202212115 java\345\244\215\344\271\240.md" | 31 ------------ .../20221215 java\345\244\215\344\271\240.md" | 31 ++++++++++++ .../20221218 java\346\226\271\346\263\225.md" | 47 +++++++++++++++++++ 3 files changed, 78 insertions(+), 31 deletions(-) delete mode 100644 "18 \345\276\220\346\260\270\346\267\263/202212115 java\345\244\215\344\271\240.md" create mode 100644 "18 \345\276\220\346\260\270\346\267\263/20221218 java\346\226\271\346\263\225.md" diff --git "a/18 \345\276\220\346\260\270\346\267\263/202212115 java\345\244\215\344\271\240.md" "b/18 \345\276\220\346\260\270\346\267\263/202212115 java\345\244\215\344\271\240.md" deleted file mode 100644 index 8eaa9f2..0000000 --- "a/18 \345\276\220\346\260\270\346\267\263/202212115 java\345\244\215\344\271\240.md" +++ /dev/null @@ -1,31 +0,0 @@ -作业 - -输入倒叙乘法口诀表 - -```java -public class aasd { - public static void main(String[] args) { - for (int i = 9; i >=1 ; i--) { - for (int j = i; j >=1; j--) { - System.out.print( i+ "*" +j + "=" + i * j + "\t"); - } - System.out.println(); - } - } -} -``` - -100立方燃气 第二阶梯240~360 4.05元 第三阶梯360~999999 5.06元 求第二阶梯和第三阶梯分别所占的燃气 - -```java -public class fgdg { - public static void main(String[] args) { - for (int x=1;x<=100;x++){ - if (x*4.05+(100-x)*5.06==445.4){ - System.out.println(x+"立方"); - System.out.println((100-x)+"立方"); - } - } - } -} -``` \ No newline at end of file diff --git "a/18 \345\276\220\346\260\270\346\267\263/20221215 java\345\244\215\344\271\240.md" "b/18 \345\276\220\346\260\270\346\267\263/20221215 java\345\244\215\344\271\240.md" index e69de29..8eaa9f2 100644 --- "a/18 \345\276\220\346\260\270\346\267\263/20221215 java\345\244\215\344\271\240.md" +++ "b/18 \345\276\220\346\260\270\346\267\263/20221215 java\345\244\215\344\271\240.md" @@ -0,0 +1,31 @@ +作业 + +输入倒叙乘法口诀表 + +```java +public class aasd { + public static void main(String[] args) { + for (int i = 9; i >=1 ; i--) { + for (int j = i; j >=1; j--) { + System.out.print( i+ "*" +j + "=" + i * j + "\t"); + } + System.out.println(); + } + } +} +``` + +100立方燃气 第二阶梯240~360 4.05元 第三阶梯360~999999 5.06元 求第二阶梯和第三阶梯分别所占的燃气 + +```java +public class fgdg { + public static void main(String[] args) { + for (int x=1;x<=100;x++){ + if (x*4.05+(100-x)*5.06==445.4){ + System.out.println(x+"立方"); + System.out.println((100-x)+"立方"); + } + } + } +} +``` \ No newline at end of file diff --git "a/18 \345\276\220\346\260\270\346\267\263/20221218 java\346\226\271\346\263\225.md" "b/18 \345\276\220\346\260\270\346\267\263/20221218 java\346\226\271\346\263\225.md" new file mode 100644 index 0000000..535746a --- /dev/null +++ "b/18 \345\276\220\346\260\270\346\267\263/20221218 java\346\226\271\346\263\225.md" @@ -0,0 +1,47 @@ +方法 + +return 返回值 + +void 不返回函数 + +作业 + +3. 定义一函数,用于求2个数中的较大数,并将其返回,这2个数字在主函数中由用户输入 + +```java +import java.util.Scanner; + +public class rew { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + System.out.println("输入两个数"); + sd(sc.nextDouble(), sc.nextDouble()); + } + + public static void sd(double a,double b) { + if (a>b){ + System.out.println("这个数比较大"+a); + }else { + System.out.println("这个数比较大"+b); + } + } +} +``` + +4. 在主函数中从键盘接收X, Y , Z3个数,编写函数计算这3个数的立方和并返回计算结果:S=X3+Y3+Z3 + +```java +import java.util.Scanner; + +public class ret { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + System.out.println("输入三个数"); + double sum= af(sc.nextDouble(), sc.nextDouble(), sc.nextDouble()); + System.out.println(sum); + } + public static double af(double x,double y,double z){ + return x*3+y*3+z*3; + } +} +``` \ No newline at end of file -- Gitee