From bae4466888626d45c428fe643cbe7f25ef9f7c1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E5=AF=8C?= <2744975513@qq.com> Date: Thu, 15 Dec 2022 17:42:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...15\344\271\240\344\275\234\344\270\232.md" | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 "17 \345\221\250\345\257\214/20221215 \345\244\215\344\271\240\344\275\234\344\270\232.md" diff --git "a/17 \345\221\250\345\257\214/20221215 \345\244\215\344\271\240\344\275\234\344\270\232.md" "b/17 \345\221\250\345\257\214/20221215 \345\244\215\344\271\240\344\275\234\344\270\232.md" new file mode 100644 index 0000000..07dea28 --- /dev/null +++ "b/17 \345\221\250\345\257\214/20221215 \345\244\215\344\271\240\344\275\234\344\270\232.md" @@ -0,0 +1,28 @@ +## 作业 + +```java +public class a5 { + public static void main(String[] args) { + for (int i=0;i<=100;i++){ + if (4.05*i+(100-i)*5.06==445.4){ + System.out.println(i); + System.out.println(100-i); + } + } + } +} +``` + +```java +public class a4 { + public static void main(String[] args) { + for (int i=1;i<=9;i++){ + System.out.println(); + for (int j=1;j<=i;j++){ + System.out.print(i+"x"+j+"="+(i*j)+"\t"); + } + + } + } +} +``` \ No newline at end of file -- Gitee From 63a5c0e5b6623a35b35e2e14b2e87b84b27529c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E5=AF=8C?= <2744975513@qq.com> Date: Sun, 18 Dec 2022 17:02:32 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...71\346\263\225\344\275\234\344\270\232.md" | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 "17 \345\221\250\345\257\214/20221218 \346\226\271\346\263\225\344\275\234\344\270\232.md" diff --git "a/17 \345\221\250\345\257\214/20221218 \346\226\271\346\263\225\344\275\234\344\270\232.md" "b/17 \345\221\250\345\257\214/20221218 \346\226\271\346\263\225\344\275\234\344\270\232.md" new file mode 100644 index 0000000..574d225 --- /dev/null +++ "b/17 \345\221\250\345\257\214/20221218 \346\226\271\346\263\225\344\275\234\344\270\232.md" @@ -0,0 +1,54 @@ +## 作业 + +```java +import java.util.Scanner; +// 定义一函数,用于求2个数中的较大数,并将其返回,这2个数字在主函数中由用户输入 +public class a7 { + public static void main(String[] args) { + int c = (int) max(z(),s()); + System.out.println("最大值为"+c); + } + public static double max(int a , int b){ + return a>b?a:b; + } + public static int z(){ + Scanner sc=new Scanner(System.in); + System.out.println("请输入整数"); + return sc.nextInt(); + } + public static int s(){ + Scanner sc=new Scanner(System.in); + System.out.println("请输入整数"); + return sc.nextInt(); + } +} +``` + +```java +import java.util.Scanner; +//在主函数中从键盘接收X, Y , Z3个数,编写函数计算这3个数的立方和并返回计算结果:S=X3+Y3+Z3 +public class a8 { + public static void main(String[] args) { + int lf=(int)he(x(),y(),z()); + System.out.println("他们的立法和为"+lf); + } + public static int he(int a,int b,int c){ + return a*a*a+b*b*b+c*c*c; + } + public static int x(){ + Scanner sc=new Scanner(System.in); + System.out.println("请输入整数"); + return sc.nextInt(); + } + public static int y(){ + Scanner sc=new Scanner(System.in); + System.out.println("请输入整数"); + return sc.nextInt(); + } + public static int z(){ + Scanner sc=new Scanner(System.in); + System.out.println("请输入整数"); + return sc.nextInt(); + } +} +``` \ No newline at end of file -- Gitee