From a5449079c58d88d2ac60e5b82a70dc5c9c4495c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=95=8F?= <3234934487@qq.com> Date: Thu, 15 Dec 2022 20:22:57 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E5=85=AB=E6=AC=A1=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...a \351\232\217\346\234\272\346\225\260.md" | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 "56 \350\265\265\346\225\217/20221215 Java \351\232\217\346\234\272\346\225\260.md" diff --git "a/56 \350\265\265\346\225\217/20221215 Java \351\232\217\346\234\272\346\225\260.md" "b/56 \350\265\265\346\225\217/20221215 Java \351\232\217\346\234\272\346\225\260.md" new file mode 100644 index 0000000..ec83870 --- /dev/null +++ "b/56 \350\265\265\346\225\217/20221215 Java \351\232\217\346\234\272\346\225\260.md" @@ -0,0 +1,41 @@ +乘法表 + +``` +public class D666 { + public static void main(String[] args) { + for (int i=9;i>=1;i--){ + for (int j=i;j>=1;j--){ + System.out.print(j+"x"+i+"="+i*j+"\t"); + } + System.out.println(); + } + } + } +``` + +作业2 + +``` +public class zy18 { + public static void main(String[] args) { + for(int x=1;x<=100;x++){ + if(x*4.05+(100-x)*5.06==445.40){ + System.out.println("二档为" + x + "三档为" + (100-x)); + break; + } + } + } +} +``` + +笔记 + +``` +int类型的变量,变量名是arr数组 +索引用于访问数组中的数据使用,数组名[索引]等同于变量名,是一种特殊的变量名 +索引从0开始 +索引是连续的 +索引逐一增加,每次加1 +``` + + -- Gitee