xerga пре 1 година
комит
7d5118eba9
60 измењених фајлова са 2646 додато и 0 уклоњено
  1. 29 0
      JavaSE/.gitignore
  2. 8 0
      JavaSE/.idea/.gitignore
  3. 6 0
      JavaSE/.idea/encodings.xml
  4. 6 0
      JavaSE/.idea/misc.xml
  5. 12 0
      JavaSE/.idea/modules.xml
  6. 11 0
      JavaSE/JavaSE.iml
  7. 11 0
      JavaSE/day01/day01.iml
  8. 13 0
      JavaSE/day01/src/HelloWorld.java
  9. 27 0
      JavaSE/day01/src/Test01.java
  10. 41 0
      JavaSE/day01/src/Test02.java
  11. 58 0
      JavaSE/day01/src/Test03.java
  12. 11 0
      JavaSE/day02/day02.iml
  13. 38 0
      JavaSE/day02/src/Exer01.java
  14. 114 0
      JavaSE/day02/src/Exer02.java
  15. 70 0
      JavaSE/day02/src/Test01.java
  16. 34 0
      JavaSE/day02/src/Test02.java
  17. 39 0
      JavaSE/day02/src/Test03.java
  18. 39 0
      JavaSE/day02/src/Test04.java
  19. 27 0
      JavaSE/day02/src/Test05.java
  20. 82 0
      JavaSE/day02/src/Test06.java
  21. 40 0
      JavaSE/day02/src/Test07.java
  22. 41 0
      JavaSE/day02/src/Test08.java
  23. 51 0
      JavaSE/day02/src/Test09.java
  24. 69 0
      JavaSE/day02/src/Test10.java
  25. 41 0
      JavaSE/day02/src/Test11.java
  26. 11 0
      JavaSE/day03/day03.iml
  27. 38 0
      JavaSE/day03/src/Exer01.java
  28. 31 0
      JavaSE/day03/src/Exer02.java
  29. 51 0
      JavaSE/day03/src/Exer03.java
  30. 96 0
      JavaSE/day03/src/Exer04.java
  31. 38 0
      JavaSE/day03/src/Exer05.java
  32. 46 0
      JavaSE/day03/src/Exer06.java
  33. 49 0
      JavaSE/day03/src/HomeWork.java
  34. 38 0
      JavaSE/day03/src/Test01.java
  35. 35 0
      JavaSE/day03/src/Test02.java
  36. 36 0
      JavaSE/day03/src/Test03.java
  37. 32 0
      JavaSE/day03/src/Test04.java
  38. 58 0
      JavaSE/day03/src/Test05.java
  39. 76 0
      JavaSE/day03/src/Test06.java
  40. 26 0
      JavaSE/day03/src/Test07.java
  41. 57 0
      JavaSE/day03/src/Test08.java
  42. 11 0
      JavaSE/day04/day04.iml
  43. 49 0
      JavaSE/day04/src/com/lc/day04/arr03/Test05.java
  44. 29 0
      JavaSE/day04/src/com/lc/day04/arr04/Test01.java
  45. 63 0
      JavaSE/day04/src/com/lc/day04/arr05/Test01.java
  46. 30 0
      JavaSE/day04/src/com/lc/day04/arr05/Test02.java
  47. 35 0
      JavaSE/day04/src/com/lc/day04/arr06/Test01.java
  48. 23 0
      JavaSE/day04/src/com/lc/day04/arr07/Test01.java
  49. 39 0
      JavaSE/day04/src/com/lc/day04/bc01/Test01.java
  50. 62 0
      JavaSE/day04/src/com/lc/day04/bc02/Test02.java
  51. 66 0
      JavaSE/day04/src/com/lc/day04/bc02/Test03.java
  52. 27 0
      JavaSE/day04/src/com/lc/day04/bc02/Test04.java
  53. 52 0
      JavaSE/day04/src/com/lc/day04/exer01/Test01.java
  54. 76 0
      JavaSE/day04/src/com/lc/day04/exer01/Test02.java
  55. 34 0
      JavaSE/day04/src/com/lc/day04/exer01/Test03.java
  56. 42 0
      JavaSE/day04/src/com/lc/day04/exer01/Test04.java
  57. 95 0
      JavaSE/day04/src/com/lc/day04/exer02/Test01.java
  58. 92 0
      JavaSE/day04/src/com/lc/day04/exer02/Test02.java
  59. 179 0
      JavaSE/day04/src/com/lc/day04/exer02/Test03.java
  60. 6 0
      JavaSe01/day01/HelloWorld.java

+ 29 - 0
JavaSE/.gitignore

@@ -0,0 +1,29 @@
+### IntelliJ IDEA ###
+out/
+!**/src/main/**/out/
+!**/src/test/**/out/
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+bin/
+!**/src/main/**/bin/
+!**/src/test/**/bin/
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store

+ 8 - 0
JavaSE/.idea/.gitignore

@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml

+ 6 - 0
JavaSE/.idea/encodings.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8">
+    <file url="PROJECT" charset="UTF-8" />
+  </component>
+</project>

+ 6 - 0
JavaSE/.idea/misc.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/out" />
+  </component>
+</project>

+ 12 - 0
JavaSE/.idea/modules.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/JavaSE.iml" filepath="$PROJECT_DIR$/JavaSE.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day01/day01.iml" filepath="$PROJECT_DIR$/day01/day01.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day02/day02.iml" filepath="$PROJECT_DIR$/day02/day02.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day03/day03.iml" filepath="$PROJECT_DIR$/day03/day03.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day04/day04.iml" filepath="$PROJECT_DIR$/day04/day04.iml" />
+    </modules>
+  </component>
+</project>

+ 11 - 0
JavaSE/JavaSE.iml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 11 - 0
JavaSE/day01/day01.iml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 13 - 0
JavaSE/day01/src/HelloWorld.java

@@ -0,0 +1,13 @@
+/**
+ * ClassName: HelloWorld
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/21 15:16
+ * @Version 1.0
+ */
+public class HelloWorld {
+    //生成主函数 psvm
+    public static void main(String[] args) {
+        //输出 sout
+        System.out.println("Hello World");
+    }
+}

+ 27 - 0
JavaSE/day01/src/Test01.java

@@ -0,0 +1,27 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/21 15:31
+ * @Version 1.0
+ */
+public class Test01 {
+    //单行
+
+    /*
+        多行
+     */
+
+    /**
+     *  文档注释 后面
+     */
+    public static void main(String[] args) {
+        //小数   整数   字符串(文本)   布尔 (true false)  字符类型  字面量
+        System.out.println(1.111111);
+        System.out.println(1000);
+        System.out.println("helloworld");
+        System.out.println(true);
+        //System.out.println('中'); //单引号 自由一个字符
+        System.out.println('A');
+    }
+}

+ 41 - 0
JavaSE/day01/src/Test02.java

@@ -0,0 +1,41 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/21 15:31
+ * @Version 1.0
+ */
+public class Test02 {
+
+    public static void main(String[] args) {
+        //整数
+        byte a = 127; // 超出报错
+
+        short b = 128;
+
+        int c  = 1234567891;
+
+        long d = 12345678910L; //数值 取int long类型需要加 L
+
+        // 小数
+        float e = 1.1234567890F; // 加F
+        double f = 1.123456789987654321; // 可以加D
+
+        // char
+        char g = 'C'; //单引号
+
+        // boolean
+        boolean h = true;
+
+        //使用变量输出
+        System.out.println(a);
+        System.out.println(b);
+        System.out.println(c);
+        System.out.println(d);
+        System.out.println(e);
+        System.out.println(f);
+        System.out.println(g);
+        System.out.println(h);
+
+    }
+}

+ 58 - 0
JavaSE/day01/src/Test03.java

@@ -0,0 +1,58 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/21 15:31
+ * @Version 1.0
+ */
+public class Test03 {
+
+    public static void main(String[] args) {
+       /*
+       变量的注意事项:
+
+        - 变量名不能重复
+        - 变量未赋值,不能使用
+        - 定义long类型变量,数据后面加L 不然默认是int类型
+        - 定义float类型变量,数据后面加F
+        */
+
+//        int a = 10;
+//        int a = 20; //重复
+//
+//        int b;
+//        System.out.println(b); //未赋值
+
+        //作用域 问题
+//        int b = 20;
+//        {
+//            int a =10;
+//            System.out.println(b);
+//        }
+//
+//        System.out.println(a);
+
+        // String // 引用数据类型
+
+        String a = "tom";
+        String b = "坤坤";
+
+        System.out.println(a);
+        System.out.println(b);
+
+
+        //变量使用
+        int a1 = 10;
+
+        a1 = 20;
+
+        //+-
+        int a2 = a1 + 20; //其他变量
+
+        a1 = a1 + 20; //赋值给自己
+
+        //直接输出
+        System.out.println(a1);
+
+    }
+}

+ 11 - 0
JavaSE/day02/day02.iml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 38 - 0
JavaSE/day02/src/Exer01.java

@@ -0,0 +1,38 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Exer01 {
+
+
+    public static void main(String[] args) {
+        /*
+        1. 定义变量a 判断是否时偶数,输出boolean值
+        2. 定义变量b是否能被7整除,输出boolean值
+        3. 将变量a进行++操作,在判断是否时偶数并且能否被7整除,输出boolean值
+        4. 输出a的值
+         */
+
+        int a =102;
+
+        boolean odd = (a % 10 == 0);
+
+        System.out.println("是否是偶数:"+odd);
+
+        System.out.println("是否是偶数"+(a % 10 == 0));
+
+        int b = 107;
+
+        System.out.println("能否被7整除:"+(b % 7 == 0));
+
+        a++;
+        System.out.println("能否被7整除:"+(a % 7 == 0));
+        System.out.println("a:"+a);
+
+
+    }
+    
+}

+ 114 - 0
JavaSE/day02/src/Exer02.java

@@ -0,0 +1,114 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Exer02 {
+
+
+    public static void main(String[] args) {
+        /*
+       定义变量 分数.
+       分数小于300 当保安。大于400上本科,  大于500 一本 大于 600 上985院校 .
+         */
+        int s = 501;
+
+        if (s >= 0 && s <= 750){
+            if (s <= 300){
+                System.out.println("当保安");
+            }else if (s >= 400 && s < 500){
+                System.out.println("上本科");
+            }else if (s >= 500 && s < 600){
+                System.out.println("一本");
+            }else if (s >= 600){
+                System.out.println("上985院校");
+            }
+        }
+
+
+
+        //分数 0 - 750
+        //嵌套
+
+
+
+
+        /*
+        定义月份变量. 月份在1-3输出春季,后面省略 ,可用嵌套保证程序的健壮性.
+         */
+
+        int m = 4;
+
+        if (m >= 1 && m <= 12){
+            if ( m ==1 || m == 2 || m == 3 ){
+                System.out.println("春天");
+            }else if ( m ==4 || m == 5 || m == 6 ){
+                System.out.println("夏天");
+            }else if ( m ==7 || m == 8 || m == 9 ){
+                System.out.println("秋天");
+            }else if ( m ==10 || m == 11 || m == 12 ){
+                System.out.println("冬天");
+            }
+        }
+
+
+        //定义三个整数变量. 按顺序输出 变量的大小.从小到大.
+        int a = 20;
+        int b = 15;
+        int c = 18;
+
+        //交换
+        if (a > b){
+            //临时变量
+            int temp = a;
+            a = b;
+            b = temp;
+        }
+
+        if (b > c){
+            //临时变量
+            int temp = b;
+            b = c;
+            c = temp;
+        }
+
+        if (a > b){
+            //临时变量
+            int temp = a;
+            a = b;
+            b = temp;
+        }
+
+        System.out.println(a +" < "+ b + " < "+ c );
+
+
+        int a1 = 10;
+        int a2 = 40;
+        int a3 = 30;
+
+        if (a1 > a2){
+            if (a2 > a3){
+                System.out.println( a1 + ">" +a2 + ">"+ a3 );
+            }else{
+                if (a1 > a3){
+                    System.out.println( a1 + ">" +a3 + ">"+ a2 );
+                }else{
+                    System.out.println( a3 + ">" +a1 + ">"+ a2 );
+                }
+            }
+        }else{
+            //a2
+            if (a1 > a3){ //
+                System.out.println( a2 + ">" +a1 + ">"+ a3 );
+            }else{ // a3
+                if ( a2 > a3 ){
+                    System.out.println( a2 + ">" +a3 + ">"+ a1 );
+                }else{
+                    System.out.println( a3 + ">" +a2 + ">"+ a1 );
+                }
+            }
+        }
+    }
+}

+ 70 - 0
JavaSE/day02/src/Test01.java

@@ -0,0 +1,70 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Test01 {
+
+    /*
+         +  -  *  /  %
+     */
+    public static void main(String[] args) {
+        // +
+        int a = 10 + 20;
+
+        int b = a + 20;
+        System.out.println(b);
+
+        // *
+        double d = 0.1 * 0.3;
+
+        System.out.println(d);
+        // / 整除
+        int i = 10 / 3;
+        System.out.println(i);
+
+        // % 模
+        int i1 = 10 % 3;
+        int i2 = -10 % 3;
+        int i3 = 10 % -3;
+        System.out.println(i1);
+        System.out.println(i2);
+        System.out.println(i3);
+
+        int a1 = 153;
+
+        int g = a1 % 10;
+        int s = a1 / 10 % 10;
+        int b1 = a1 / 100;
+
+        System.out.println("个:"+g);
+        System.out.println("十:"+s);
+        System.out.println("百:"+b1);
+
+
+        //练习
+        /*
+        马晕一天能赚5个亿左右,就是5个小目标,假如普通人一天可以赚120元,
+        一个月赚4200元,那么想赚够马晕一天的收益,需要多少个月零几天?
+
+        先算出 月份  再算天数
+        分析:
+        月份 = 5个亿  /  4200;
+        天数 =   5个亿  %  4200  / 120;
+         */
+
+        int c = 500000000;
+        int m = 4200;
+        int day = 120;
+
+        //月份
+        System.out.println( "月"+ (c / m));
+        //天数
+        System.out.println( "天"+ (c % m / day));
+    }
+
+
+
+}

+ 34 - 0
JavaSE/day02/src/Test02.java

@@ -0,0 +1,34 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Test02 {
+
+    /*
+        + 号特殊用法
+     */
+    public static void main(String[] args) {
+        byte a1 = 10;
+        byte a2 = 10;
+
+        //byte a3 = a1 + a2;  // ( 编译 )
+
+        //byte a4 = a1 + 10;  // ( 编译 )
+
+        //byte a5 = 10 + 10;    //  不报错
+
+        // + 可以连接字符窜
+        System.out.println(a1+"2"); // 连接
+        //整数 a1+1 相同类型 先做 + 法 之后做连接
+        System.out.println(a1+1+"2"+a2); // 11210
+        //两两 运算 前后顺序
+        System.out.println(a1+1+"2"+a2+10); // 1121010
+
+    }
+
+
+
+}

+ 39 - 0
JavaSE/day02/src/Test03.java

@@ -0,0 +1,39 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Test03 {
+
+    /*
+        + 号特殊用法
+            ++ 自增 : 自身 + 1
+                前++ :单独形成一行,没有任何影响
+                     : 参与运算 : 前++ 先自身加1. 再运算
+                后++ :单独形成一行,没有任何影响
+                     : 参与运算 : 先获取值 进行运算, 运算之后在+1
+        - 号
+            -- 自减 : 自身 -1
+     */
+    public static void main(String[] args) {
+        int a1 = 10;
+        //a1++;
+        ++a1;
+        System.out.println(a1);
+
+        int a2 = 20;
+
+        //int a3 = a2++ +10;  // 30 在取20的值 做运算 20 + 10 = 30
+        int a4 = ++a2 +10;    // 31 先加1  a2 = 21 在和 10 相加 = 31
+
+        //System.out.println(a3);
+        System.out.println(a4);
+
+        System.out.println(a2);
+    }
+
+
+
+}

+ 39 - 0
JavaSE/day02/src/Test04.java

@@ -0,0 +1,39 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Test04 {
+
+
+    public static void main(String[] args) {
+        //String str1 = 4;                       //判断对错:
+        String str2 = 3.5F + "";               //判断str2对错:
+        System.out.println(str2);              //输出:
+        System.out .println(3+4+"Hello!");     //输出:
+        System.out.println("Hello!"+3+4);      //输出:
+        System.out.println('a'+1+"Hello!");    //输出:数据类型转换
+        System.out.println("Hello"+'a'+1);     //输出:
+
+        //分析
+//        int i = 1;  // 2  3  4
+//        //      1   +   3 * 3
+//        int k = i++ + ++i * i++;
+//        System.out.println("k = " + k); //? 10
+//        System.out.println("i = " + i); //? 4
+
+
+        int i = 2;
+        int j = i++;
+        System.out.println(j); // 2
+        System.out.println(i); // 3
+
+        int m = 2;
+        m = m++;   //
+        //(1)先取m的值“2”放操作数栈 (2)m再自增,m=3 (3)再把操作数栈中的"2"赋值给m,m=2
+        System.out.println(m);
+    }
+
+}

+ 27 - 0
JavaSE/day02/src/Test05.java

@@ -0,0 +1,27 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Test05 {
+
+
+    public static void main(String[] args) {
+        // +=
+
+        int a = 10;
+
+        a+=20; // a = a + 20;
+
+        System.out.println(a);
+
+        int b = 10;
+
+        b %= 3; // b = b % 3;
+
+        System.out.println(b);
+    }
+    
+}

+ 82 - 0
JavaSE/day02/src/Test06.java

@@ -0,0 +1,82 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Test06 {
+
+
+    public static void main(String[] args) {
+        // 自动转换
+        byte a1 = 10;
+
+        //int 接收
+        int a2 = a1;
+
+        // + a1 byte 10 int
+        /*
+                                              0000 1010
+                0000 0000 0000 0000 0000 0000 0000 1010
+         */
+        int a3 = a1 + 10;
+
+        // byte short char 都转成int
+        byte a4 = 10;
+        byte a5 = 10;
+        short a6 = 10;
+        char a7 = 'a'; //a7 码表
+
+        //short i = a4 + a5;
+        int a8 = a7 + 1; // a = 码表 值 a = 97  98
+        System.out.println(a8);
+
+        int a10 = 120 ;
+        double a11 = a10;
+
+
+        //强制转换 : 损失精度。
+        int i1 = 128;
+
+        byte i2 = (byte) i1;
+        System.out.println(i2); //-128
+        // 底层存储
+        // 0000 0000 1000 0000  int
+        // 1000 0000 byte 1000 0000 = -128
+
+        int i3 = 12345;
+        byte i4 = (byte) i3;
+        System.out.println(i4); // 57
+
+        // 0011 0000 0011 1001
+        //           0011 1001
+
+
+        /*
+            short s = 10
+            s = s + 2;和  s += 2  区别
+
+         */
+
+        short s = 10;
+        //s = s + 2; // 编译不通过  2 常量 常量默认是 int  结果 是 int
+
+        s += 2; // 编译通过  2 常量  += 运算符 本质是强制转换
+        //s = (short) (s+2);
+
+        int b1 = 10;
+        double b2 = b1;
+
+        double b3 = 10;
+        System.out.println(b2);
+        System.out.println(b3);
+
+        char c = 'a'; // 本质 是 97 代表 a
+
+        byte b4 = 100; //常量优化
+        // byte b5 = 128; //常量优化
+
+    }
+    
+}

+ 40 - 0
JavaSE/day02/src/Test07.java

@@ -0,0 +1,40 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Test07 {
+
+
+    public static void main(String[] args) {
+
+        //int
+        int a1 = 10;
+        int a2 = 20;
+        boolean b1 = (a1 == a2);
+        System.out.println(b1);
+
+        System.out.println(4 != 3);
+
+        int i1 = 10;
+        int i2 = 20;
+        System.out.println(i1 == i2);//false
+        System.out.println(i1 != i2);//true
+        System.out.println(i1 >= i2);//false
+
+
+        int m = 10;
+        int n = 20;
+        System.out.println(m == n);//false
+        System.out.println(m = n);//20 // 赋值
+
+        boolean b3 = false;
+        boolean b2 = true;
+        System.out.println(b1 == b2);//false
+        System.out.println(b1 = b2);//true
+
+    }
+    
+}

+ 41 - 0
JavaSE/day02/src/Test08.java

@@ -0,0 +1,41 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Test08 {
+
+
+    public static void main(String[] args) {
+
+        System.out.println(3==3 & 3!=4); //T & T T
+
+        int i=1;
+//        System.out.println(1 == 1 & i++ == 2 ); // F
+//        System.out.println(i); // 2
+//        System.out.println(2 == 1 & i++ == 2 ); // F
+//        System.out.println(i ); // i++ 运行
+
+        //&& 短路
+//        System.out.println(2 == 1 && i++ == 2 ); // 前面2 == 1返回 F 后面不执行
+//        System.out.println(i ); // i++ 不运行
+
+        // ||
+//        System.out.println(1 == 1 || i++ == 2 ); // 前面1 == 1返回 T 后面不执行
+//        System.out.println(i ); // i++ 不运行
+
+        System.out.println(1 == 1 | i++ == 2 ); // 前面1 == 1返回 T 后面执行
+        System.out.println(i ); // i++ 运行
+
+        //用  双 && 双 ||
+
+        System.out.println(1==1 ^ 1==2);
+        System.out.println(1==1 ^ 2==2);
+
+
+
+    }
+    
+}

+ 51 - 0
JavaSE/day02/src/Test09.java

@@ -0,0 +1,51 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Test09 {
+
+
+    public static void main(String[] args) {
+
+        //状态
+        boolean isRed = true;
+
+        //判断 是红  返回停止  不是 返回通行
+        String result = ( isRed  ) ? "停止" : "通行";
+
+
+        System.out.println(result);
+        //注意: 值1 和 值2 必须兼容。
+        //      三元运算符 必须有结果赋值。
+
+        //比较两个数的大小 返回大的数字
+        int a1 = 20;
+        byte a2 = 30;
+
+        int a3 = ( a1 > a2 ) ? a1 : a2;
+
+        System.out.println(a3);
+
+
+        //获取三个数中的最大值
+        int i1 = 40;
+        int i2 = 20;
+        int i3 = 30;
+
+        //两个两个比较
+        int max = i1 > i2 ? i1 : i2;
+
+        // 比较 i3
+        max = max > i3 ? max : i3;
+
+        System.out.println(max);
+
+        //不推荐
+        int i = (i1 > i2 ? i1 : i2) > i3 ? (i1 > i2 ? i1 : i2) : i3;
+        System.out.println(i);
+    }
+    
+}

+ 69 - 0
JavaSE/day02/src/Test10.java

@@ -0,0 +1,69 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Test10 {
+
+    /*
+        if语句
+
+        2023.8.24是小日本子核废水排污的日子,这一天终将被历史铭记.
+        需求:定义时间20230824 如果等于此刻 投放核弹 炸死小日本.
+
+        String
+        int
+
+
+        小日本最终的结局只有两个,被核弹消灭,被海洋淹没.但是需要形成一定的条件.
+        如果有战争小日本被核弹消灭,没有被海洋淹没.
+        需求:定义定义变量 war 如果是true 用核弹消灭小日本,否则被海水淹没.
+
+
+        小明公司出品干死小日本游戏,在游戏中对于杀死小日本人数,给出响应奖励.
+
+        - 杀死  10人以内, 奖励人民币100元.
+        - 杀死  10 - 100 人以内, 奖励华为手机一部.
+        - 杀死  100 - 1000 人以内, 奖励奇瑞汽车一台.
+        - 杀死  1000 - 10000 人以内, 奖励保时捷.
+
+     */
+    public static void main(String[] args) {
+        int date = 20230825;
+
+        if (date == 20230824){
+            System.out.println("投放核弹 炸死小日本");
+        }
+
+        //if else
+
+        boolean war = false;
+
+        if (war){
+            System.out.println("用核弹消灭小日本");
+        }else{
+            System.out.println("被海水淹没");
+        }
+
+        //if else if ... else
+        System.out.println("-----------------");
+
+        int persons = -1;
+
+        if ( persons > 0 && persons <=10 ){
+            System.out.println("奖励人民币100元.");
+        }else if (persons > 10 && persons <=100){
+            System.out.println("奖励华为手机一部.");
+        }else if (persons > 100 && persons <=1000){
+            System.out.println("汽车.");
+        }else if (persons > 1000 && persons <=10000){
+            System.out.println("奖励保时捷.");
+        }else{
+            System.out.println("没有对应的奖励");
+        }
+
+    }
+    
+}

+ 41 - 0
JavaSE/day02/src/Test11.java

@@ -0,0 +1,41 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Test11 {
+
+    public static void main(String[] args) {
+
+        if (false)
+            System.out.println("123");
+        // 将 if后面下一条执行语句 为执行体
+        // 省略必须有缩进
+        System.out.println("456");
+
+
+        if(true){};
+        //; 结尾
+        System.out.println("111");
+
+
+        int a1 = 10;
+        int a2 = 20;
+
+        int max;
+        if (a1> a2){
+            max = a1;
+            System.out.println("a1>a2");
+        }else{
+            max = a2;
+            System.out.println("a2>a1");
+        }
+
+        max = ( a1 > a2) ? a1 : a2;
+
+
+    }
+    
+}

+ 11 - 0
JavaSE/day03/day03.iml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 38 - 0
JavaSE/day03/src/Exer01.java

@@ -0,0 +1,38 @@
+import java.util.Scanner;
+
+/**
+ * ClassName: Exer01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 10:19
+ * @Version 1.0
+ */
+/*
+大家都知道,如果想成为一名ikun,当然要提出一定的条件:是否中分:是; 背带裤:是; 篮球:是。
+
+如果这三个条件同时满足,则:“真爱粉”
+如果三个条件有为真的情况,则:“假ikun”
+如果三个条件都不满足,则:“小黑子!”
+ */
+public class Exer01 {
+    public static void main(String[] args) {
+        Scanner scanner = new Scanner(System.in);
+        System.out.println("是否中分(1/0)");
+        int i = scanner.nextInt();
+
+        System.out.println("背带裤:(true/flase)");
+        boolean b = scanner.nextBoolean();
+
+        System.out.println("背带裤:是/否 ");
+        String s = scanner.next();
+
+        if ( i == 1 && b && s.equals("是") ){
+            System.out.println("真爱粉");
+        }else if (i == 1 || b || s.equals("是")){
+            System.out.println("假ikun");
+        }else if (i != 1 && !b && !s.equals("是")){
+            System.out.println("小黑子!");
+        }
+        
+    }
+}

+ 31 - 0
JavaSE/day03/src/Exer02.java

@@ -0,0 +1,31 @@
+import java.util.Scanner;
+
+/**
+ * ClassName: Exer01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 10:19
+ * @Version 1.0
+ */
+/*
+输入学生年龄,如果大于18岁的,输出“成年人”。低于18岁的,输出“青少年”。
+ */
+public class Exer02 {
+    public static void main(String[] args) {
+
+        Scanner scanner = new Scanner(System.in);
+        System.out.println("请输入年龄");
+        int age = scanner.nextInt();
+
+        switch (age/18){
+            case 0:
+                System.out.println("青少年");
+                break;
+            case 1,2,3,4: //新语法
+                System.out.println("成年人");
+                break;
+
+        }
+
+    }
+}

+ 51 - 0
JavaSE/day03/src/Exer03.java

@@ -0,0 +1,51 @@
+import java.util.Scanner;
+
+/**
+ * ClassName: Exer01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 10:19
+ * @Version 1.0
+ */
+/*
+从键盘上输入2023年的“month”和“day”,要求通过程序输出输入的日期为2023年的第几天。
+ */
+public class Exer03 {
+    public static void main(String[] args) {
+
+
+        int month = 2;
+        int day = 28;
+
+        int days = 0;
+
+        switch (month){
+            case 12:
+                days += 30;
+            case 11:
+                days += 31;
+            case 10:
+                days += 30;
+            case 9:
+                days += 31;
+            case 8:
+                days += 31;
+            case 7:
+                days += 30;
+            case 6:
+                days += 31;
+            case 5:
+                days += 30;
+            case 4:
+                days += 31;
+            case 3:
+                days += 28;
+            case 2:
+                days += 31;
+            case 1:
+                days+=day;
+
+        }
+        System.out.println(days);
+    }
+}

+ 96 - 0
JavaSE/day03/src/Exer04.java

@@ -0,0 +1,96 @@
+import java.util.Scanner;
+
+/**
+ * ClassName: HomeWork
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 9:19
+ * @Version 1.0
+ */
+public class Exer04 {
+    /*
+    定义 年、月、日,要求年份必须是正整数,月份范围是[1,12],
+    日期也必须在本月总天数范围内,如果输入正确,输出“年-月-日”结果,否则提示输入错误。
+
+    从键盘上输入 year年的“month”和“day”,要求通过程序输出输入的日期为year年的第几天。 闰年
+
+     */
+    public static void main(String[] args) {
+
+        //键盘输入
+        Scanner scanner = new Scanner(System.in);
+        System.out.println("请入年份");
+        int year = scanner.nextInt();
+        System.out.println("请入月份");
+        int m = scanner.nextInt();
+        System.out.println("请入天数");
+        int day = scanner.nextInt();
+
+        int sum = 0;
+
+        if ( year > 0 ){
+            //月份范围是[1,12]
+            if ( m >= 1 && m <=12 ){
+                //日期也必须在本月总天数范围内
+                int days;
+                if (m == 1 || m==3 || m==5 || m==7 || m==8 || m==10 || m==12){
+                    days=31;
+                }else if ( m == 2 ){
+                    //闰年 判断
+                    if (year % 4== 0 && year%100 != 0 || year % 400 == 0){
+                        days= 29;
+                    }else {
+                        days =28;
+                    }
+                }else{
+                    // 4 6 9 11月
+                    days = 30;
+                }
+                //判断
+                if ( day >= 1 && day <= days){
+
+                    System.out.println(year+"年-"+m+"月-"+days+"日");
+
+                    switch (m){
+                        case 12:
+                            sum += 30;
+                        case 11:
+                            sum += 31;
+                        case 10:
+                            sum += 30;
+                        case 9:
+                            sum += 31;
+                        case 8:
+                            sum += 31;
+                        case 7:
+                            sum += 30;
+                        case 6:
+                            sum += 31;
+                        case 5:
+                            sum += 30;
+                        case 4:
+                            sum += 31;
+                        case 3:
+                            if ( year % 4== 0 && year%100 != 0 || year % 400 == 0  ){
+                                sum++;
+                            }
+                            sum += 28;
+                        case 2:
+                            sum += 31;
+                        case 1:
+                            sum+=day;
+
+                    }
+                    System.out.println(year+"年-"+m+"月-"+day+"日是第"+sum+"天");
+
+                }else{
+                    System.out.println("日期也必须在本月总天数范围内");
+                }
+            }else{
+                System.out.println("月份范围是[1,12]");
+            }
+        }else {
+            System.out.println("年份必须是正整数");
+        }
+    }
+}

+ 38 - 0
JavaSE/day03/src/Exer05.java

@@ -0,0 +1,38 @@
+import java.util.Scanner;
+
+/**
+ * ClassName: HomeWork
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 9:19
+ * @Version 1.0
+ */
+public class Exer05 {
+    public static void main(String[] args) {
+        //判断1-100之间,有多少个7.
+
+        int count = 0;
+        for (int i = 1; i < 100; i++) {
+            if ( i % 10 == 7 ){
+                count++;
+            }
+            if ( i / 10 == 7 ){
+                count++;
+            }
+        }
+        System.out.println(count);
+
+
+        //输出一个三位数的水仙花数字.
+        for (int i = 100; i < 999 ; i++) {
+            //个位十位百位
+            int g = i % 10;
+            int s = i / 10 % 10;
+            int b = i / 100;
+
+            if (i == g*g*g + s*s*s + b*b*b){
+                System.out.println(i);
+            }
+        }
+    }
+}

+ 46 - 0
JavaSE/day03/src/Exer06.java

@@ -0,0 +1,46 @@
+import java.util.Scanner;
+
+/**
+ * ClassName: Exer06
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 16:12
+ * @Version 1.0
+ */
+public class Exer06 {
+
+    /*
+    练习:键盘输入一个数字.判断其是否是 素数( 素数只能被1-本身整除的数字 )
+    判断其是否是 素数
+
+    举例 7   13   17  19
+     7
+        2 3 4 5 6
+     */
+    public static void main(String[] args) {
+        Scanner scanner = new Scanner(System.in);
+
+        int num = scanner.nextInt();
+        //判断标识
+        boolean flag = true;
+
+        for (int i = 2; i < num; i++) {
+            //判断每一个 i
+            if ( num % i == 0){
+                //有一个i 可以被模开 不是素数 改变标识
+                flag = false;
+            }
+        }
+
+        //标识判断
+        if (flag){
+            System.out.println(num+"是一个素数");
+        }else {
+            System.out.println(num+"不是一个素数");
+        }
+
+
+    }
+
+
+}

+ 49 - 0
JavaSE/day03/src/HomeWork.java

@@ -0,0 +1,49 @@
+/**
+ * ClassName: HomeWork
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 9:19
+ * @Version 1.0
+ */
+public class HomeWork {
+    /*
+    定义 年、月、日,要求年份必须是正整数,月份范围是[1,12],
+    日期也必须在本月总天数范围内,如果输入正确,输出“年-月-日”结果,否则提示输入错误。
+     */
+    public static void main(String[] args) {
+        int year = 2001;
+        int m = 2;
+        int day = 29;
+
+        if ( year > 0 ){
+            //月份范围是[1,12]
+            if ( m >= 1 && m <=12 ){
+                //日期也必须在本月总天数范围内
+                int days;
+                if (m == 1 || m==3 || m==5 || m==7 || m==8 || m==10 || m==12){
+                    days=31;
+                }else if ( m == 2 ){
+                    //闰年 判断
+                    if (year % 4== 0 && year%100 != 0 || year % 400 == 0){
+                        days= 29;
+                    }else {
+                        days =28;
+                    }
+                }else{
+                    // 4  6 9 11月
+                    days = 30;
+                }
+                //判断
+                if ( day >= 1 && day <= days){
+                    System.out.println(year+"年-"+m+"月-"+days+"日");
+                }else{
+                    System.out.println("日期也必须在本月总天数范围内");
+                }
+            }else{
+                System.out.println("月份范围是[1,12]");
+            }
+        }else {
+            System.out.println("年份必须是正整数");
+        }
+    }
+}

+ 38 - 0
JavaSE/day03/src/Test01.java

@@ -0,0 +1,38 @@
+import java.util.Scanner;
+
+/**
+ * ClassName: Test01 键盘输入
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 9:44
+ * @Version 1.0
+ */
+public class Test01 {
+
+    public static void main(String[] args) {
+        //导入
+
+        //创建对象
+        // 类型  变量   =  new 构造方法(参数);
+        Scanner scanner = new Scanner(System.in);
+
+        //调用
+        System.out.println("请输入Int类型");
+        int i = scanner.nextInt();
+        //结果赋值给 i
+
+        System.out.println("输入的值:"+i);
+
+
+        System.out.println("请输入Double类型");
+        double d = scanner.nextDouble();
+        //结果赋值给 i
+
+        System.out.println("输入的值:"+ d);
+
+        System.out.println("请输入Boolean类型");
+        boolean b = scanner.nextBoolean();
+        System.out.println("输入的值:"+b);
+
+    }
+}

+ 35 - 0
JavaSE/day03/src/Test02.java

@@ -0,0 +1,35 @@
+/**
+ * ClassName: Test02
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 10:40
+ * @Version 1.0
+ */
+public class Test02 {
+    public static void main(String[] args) {
+        //随机数
+        double random = Math.random();
+        //0-1 小数数字
+        System.out.println(random);
+
+        //0 - 100
+        double v = random * 100;
+        System.out.println(v);
+
+        //转换
+        int i = (int) v;
+
+        System.out.println(i);
+
+        // 50 - 100
+
+        // 0-50  + 50 ;
+        int i1 = (int) (Math.random() * 50) + 50; // 0-49
+        System.out.println(i1);
+
+        // a - b;
+        // (int) (Math.random() * a - b) + a
+
+
+    }
+}

+ 36 - 0
JavaSE/day03/src/Test03.java

@@ -0,0 +1,36 @@
+import java.util.Scanner;
+
+/**
+ * ClassName: Switch语句
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 10:40
+ * @Version 1.0
+ */
+public class Test03 {
+    public static void main(String[] args) {
+
+        Scanner scanner = new Scanner(System.in);
+        System.out.println("请输入季节");
+        String next = scanner.next();
+
+        //switch
+        switch (next){
+            case "春":
+                System.out.println("春天,万物复苏");
+                break; //break 在switch 作用结束 switch语句
+            case "夏":
+                System.out.println("夏天,热热热热");
+                break;
+            case "秋":
+                System.out.println("夏天,丰收");
+                break;
+            case "冬天":
+                System.out.println("夏天,寒冷");
+                break;
+            default:
+                System.out.println("没这个季节");
+                //break;
+        }
+    }
+}

+ 32 - 0
JavaSE/day03/src/Test04.java

@@ -0,0 +1,32 @@
+import java.util.Scanner;
+
+/**
+ * ClassName: Switch语句 特点
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 10:40
+ * @Version 1.0
+ */
+public class Test04 {
+    public static void main(String[] args) {
+
+        char a = '4';
+
+        //switch
+        switch (a) {
+
+            case '1':
+                System.out.println("夏天,寒冷");
+
+            case '2':
+                System.out.println("夏天,寒冷");
+
+            case '3':
+                System.out.println("夏天,寒冷");
+
+            default:
+                System.out.println("默认");
+
+        }
+    }
+}

+ 58 - 0
JavaSE/day03/src/Test05.java

@@ -0,0 +1,58 @@
+/**
+ * ClassName: for 循环
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 10:40
+ * @Version 1.0
+ *
+ *
+ *
+ */
+public class Test05 {
+    public static void main(String[] args) {
+
+        //循环 加上 号码
+        for (
+                int i = 0 ;
+                i < 10 ;
+                i++ ){
+            System.out.println( "第"+(i+1)+"次输出hello world");
+            //System.out.println( "第"+(i++)+"次输出hello world");
+        }
+
+        //执行流程
+        /*
+            执行 初始化,
+
+            条件判断
+
+            执行 循环体
+
+            迭代   条件判断    循环体  迭代 判断 为 false 结束。
+         */
+
+
+        //案例2: 输出1-100的奇数数字.
+        for (int i = 1; i <= 100  ; i++){
+            if ( i % 2 != 0 ){
+                System.out.println(i);
+            }
+        }
+
+
+        //案例3: 算出1-100的偶数数字的总和.
+        int sum = 0;
+
+        for (int i = 1; i <= 100; i++) {
+
+            if (i % 2 ==0){
+                //和
+                sum +=i; // sum = sum + i;
+            }
+        }
+
+        System.out.println("和"+sum);
+
+
+    }
+}

+ 76 - 0
JavaSE/day03/src/Test06.java

@@ -0,0 +1,76 @@
+import java.util.Scanner;
+
+/**
+ * ClassName: Test06 while循环
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 15:24
+ * @Version 1.0
+ */
+public class Test06 {
+
+    public static void main(String[] args) {
+        //10 次helloworld
+
+        //初始化 1
+        int i = 0;
+        //判断 2
+        while ( i < 10 ){
+            //循环体 3
+            System.out.println((i+1)+"helloworld");
+            //迭代 4
+            i++;
+        }
+        // 1 2 3 4 2 3 4
+
+
+        // 案例1:
+        // 水井深12米,青蛙第一天跳1米,之后每天比前一天多跳0.2米.请问几天能跳出井.
+        double l = 12;
+        int days = 0;
+        double a = 1;
+
+        while (l > 0){
+            //迭代
+            l = l - a;
+
+            //迭代
+            a +=0.2;
+
+            //统计
+            ++days;
+        }
+
+        System.out.println(days);
+
+
+        /*
+        随机生成一个100以内的数,猜这个随机数是多少?
+        从键盘输入数,如果大了,提示大了;如果小了,提示小了;如果对了,就不再猜了,并统计一共猜了多少次。
+        提示:生成一个[a,b] 范围的随机数的方式:(int)(Math.random() * (b - a + 1) + a)
+         */
+
+        //对象
+        Scanner scanner = new Scanner(System.in);
+        //随机数
+        int random = (int) (Math.random()*100);
+        //输入数字
+        System.out.println("请输入1-100之间的数字");
+        int number = scanner.nextInt();
+
+        while ( random != number ){
+            if (number > random){
+                System.out.println("猜大了");
+            }
+
+            if (  number < random){
+                System.out.println("猜小了");
+            }
+            System.out.println("重新输入1-100之间的数字");
+            number = scanner.nextInt();
+        }
+
+        System.out.println("正确:"+number);
+
+    }
+}

+ 26 - 0
JavaSE/day03/src/Test07.java

@@ -0,0 +1,26 @@
+/**
+ * ClassName: Test07
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 16:25
+ * @Version 1.0
+ */
+public class Test07 {
+    /*
+    do while循环
+     */
+
+    public static void main(String[] args) {
+
+        int i = 0;
+        do {
+            System.out.println("hello world");
+            i++;
+        }while (false);
+
+        //无条件执行一次
+
+    }
+
+
+}

+ 57 - 0
JavaSE/day03/src/Test08.java

@@ -0,0 +1,57 @@
+/**
+ * ClassName: 循环嵌套
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 16:25
+ * @Version 1.0
+ */
+public class Test08 {
+
+
+    public static void main(String[] args) {
+
+        for (int i = 0; i < 5; i++) {
+            for (int k = 0; k < 5; k++) {
+                System.out.print(" * ");
+            }
+            System.out.println();
+        }
+        // i 行数
+        // k 列数
+
+        /*
+            *
+            * *
+            * * *
+            * * * *
+            * * * * *
+         */
+        for (int i = 1; i <= 5; i++) {
+            for (int j = 1; j <= i  ; j++) {
+                System.out.print(" * ");
+            }
+            System.out.println();
+        }
+
+        System.out.println("---------------------");
+        /*
+
+         * * * * *
+         * * * *
+         * * *
+         * *
+         *
+
+         */
+
+        for (int i = 1; i <= 5; i++) {
+            for (int j = 1; j <= 5 - (i - 1)  ; j++) {
+                System.out.print(" * ");
+            }
+            System.out.println();
+        }
+
+    }
+
+
+}

+ 11 - 0
JavaSE/day04/day04.iml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 49 - 0
JavaSE/day04/src/com/lc/day04/arr03/Test05.java

@@ -0,0 +1,49 @@
+package com.lc.day04.arr03;
+
+/**
+ * ClassName: Test05
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 10:12
+ * @Version 1.0
+ */
+public class Test05 {
+
+    //数组的使用
+    public static void main(String[] args) {
+        //声明
+        //String[] names;
+
+        //初始化 赋值
+        // 静态初始化 复杂
+        String[] names1 = new String[]{ "张三","李四","坤坤" };
+
+        // 静态初始化 简单
+        int[] ages = {22,26,29};
+
+        // 动态初始化
+        String[] names2 = new String[3];
+
+
+        //引用数据类型 位置 在堆中 回首元素的地址
+        System.out.println(names1); //地址值。[Ljava.lang.String;@4eec7777
+
+        //连续的空间
+        // 下标 0 - 长度-1
+        System.out.println(names1[0]);
+        System.out.println(names1[1]);
+        System.out.println(names1[2]);
+
+        //数组的长度 固定
+        // 属性 length
+        //names1.length = 10; //不可以 更改
+        System.out.println("数组的长度:"+names1.length);
+
+        //通过索引操作效率非常高
+
+        //回首元素的地址 第一个元素的地址。
+
+
+
+    }
+}

+ 29 - 0
JavaSE/day04/src/com/lc/day04/arr04/Test01.java

@@ -0,0 +1,29 @@
+package com.lc.day04.arr04;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 11:01
+ * @Version 1.0
+ */
+public class Test01 {
+    //数组遍历
+    public static void main(String[] args) {
+
+        String[] moves = {"灌篮高手","志愿军","长津湖","北纬38度","金刚川"};
+        //遍历
+        //  moves.length 数组长度
+        for (int i = 0; i < moves.length; i++) {
+            //索引
+            System.out.print(" "+moves[i]);
+        }
+
+        moves[1] = "志愿军:雄兵出击";
+        System.out.println();
+        //遍历
+        for (int i = 0; i < moves.length; i++) {
+            System.out.print(" "+moves[i]);
+        }
+    }
+}

+ 63 - 0
JavaSE/day04/src/com/lc/day04/arr05/Test01.java

@@ -0,0 +1,63 @@
+package com.lc.day04.arr05;
+
+import java.util.Arrays;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 14:34
+ * @Version 1.0
+ */
+public class Test01 {
+
+    // 创建一个长度为6的int型数组,
+    // 要求数组元素的值都在1-10之间,且是随机赋值元素的值各不相同。
+    /*
+        [ 1 ,2 ,3 ,4  , , ]
+
+        随机数 1  2  3  4  4
+
+        第几个 元素 外层的 i
+
+                   内层循环  比较  是否 重写  通过 i 控制 内层循环 比较次数。
+
+                   标识
+                   i --
+     */
+    public static void main(String[] args) {
+        //数组
+        int[] arr = new int[6];
+
+        for (int i = 0; i < arr.length; i++) {
+            //随机数
+            int random =(int)(Math.random() * 10)+1;
+            //赋值
+            arr[i] = random;
+            //比较
+            for (int k = 0; k < i; k++) {
+                if (arr[k] == random){
+                    i --;
+                    break;
+                }
+            }
+        }
+
+        //Arrays.toString遍历输出
+        System.out.println(Arrays.toString(arr));
+    }
+
+    //动态初始化
+    public static void main1(String[] args) {
+        //数组
+        int[] arr = new int[3];
+
+        //索引
+        arr[0] = 22;
+
+        System.out.println(arr[0]);
+
+    }
+
+
+}

+ 30 - 0
JavaSE/day04/src/com/lc/day04/arr05/Test02.java

@@ -0,0 +1,30 @@
+package com.lc.day04.arr05;
+
+import java.util.Arrays;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 14:34
+ * @Version 1.0
+ */
+public class Test02 {
+
+
+    public static void main(String[] args) {
+        //数组
+        int[] arr = new int[6];
+        System.out.println(arr[0]);
+
+        double[] arr1 = new double[2];
+        System.out.println(arr1[0]); //0.0
+
+        //string
+        String[] arr2 = new String[2];
+
+        System.out.println(arr2[0]); //null
+    }
+
+
+}

+ 35 - 0
JavaSE/day04/src/com/lc/day04/arr06/Test01.java

@@ -0,0 +1,35 @@
+package com.lc.day04.arr06;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 15:22
+ * @Version 1.0
+ */
+public class Test01 {
+    public static void main(String[] args) {
+
+        int[] arr1 = new int[3];
+        int[] arr2 = new int[3];
+        int[] arr3 = new int[3];
+
+        System.out.println(arr1); //7777
+        arr1[0] = 1;
+        arr1[1] = 2;
+        arr1[2] = 3;
+        //地址
+        arr2 = arr1;
+
+        arr3 = arr2;
+
+        System.out.println(arr2[0]); // ?
+        System.out.println(arr2[1]); //
+        System.out.println(arr2[2]); //
+
+
+        System.out.println(arr3[0]);
+        System.out.println(arr3[1]);
+        System.out.println(arr3[2]);
+    }
+}

+ 23 - 0
JavaSE/day04/src/com/lc/day04/arr07/Test01.java

@@ -0,0 +1,23 @@
+package com.lc.day04.arr07;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 15:37
+ * @Version 1.0
+ */
+public class Test01 {
+
+    public static void main(String[] args) {
+        int[] arr  = new int[2];
+
+        //ArrayIndexOutOfBoundsException 数组越界
+        //System.out.println(arr[2]); //不存在
+
+        arr = null;
+        System.out.println(arr[0]);
+
+        //NullPointerException 空指针异常
+    }
+}

+ 39 - 0
JavaSE/day04/src/com/lc/day04/bc01/Test01.java

@@ -0,0 +1,39 @@
+package com.lc.day04.bc01;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 9:24
+ * @Version 1.0
+ */
+public class Test01 {
+    //break和continue
+    public static void main(String[] args) {
+
+        //break continue
+        // 关键字后面不能写代码
+        for (int i = 0; i < 10; i++) {
+            if (i == 3 ){
+                //break;
+                continue;
+            }
+            System.out.println("hello "+i);
+        }
+
+        System.out.println("----------------");
+        int k = 0;
+        while (true){
+            if ( k == 3 ){
+                //break;
+                continue;
+            }
+            System.out.println("hello "+k);
+            k++;
+        }
+
+
+        //
+
+    }
+}

+ 62 - 0
JavaSE/day04/src/com/lc/day04/bc02/Test02.java

@@ -0,0 +1,62 @@
+package com.lc.day04.bc02;
+
+/**
+ * ClassName: Test02
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 9:30
+ * @Version 1.0
+ */
+public class Test02 {
+    /*
+    **题目:找出100以内所有的素数(质数)?100000以内的呢?**
+
+    目的:不同的代码的实现方式,可以效率差别很大。
+
+    分析:素数(质数):只能被1和它本身整除的自然数。  --->
+    从2开始,到这个数-1为止,此范围内没有这个数的约数。则此数是一个质数。
+    比如:2、3、5、7、11、13、17、19、23、...
+
+        3-100
+        3 取模  2
+        4 取模  2 3
+        5 取模  2 3 4
+        *
+        100  取模  2 - 99
+        *
+
+        标志 判断
+
+        外循环 素数判断
+
+        内循环  素数条件
+     */
+    public static void main(String[] args) {
+        //时间
+        long start = System.currentTimeMillis();
+        // 1-100
+        for (int i = 3; i < 100000; i++) {
+            //标识
+            boolean flag = true;
+
+            //素数条件
+            for (int j = 2; j < i; j++) {
+                //取模 判断
+                if ( i % j == 0 ){
+                    //标识
+                    flag = false;
+                }
+            }
+            //判断
+            if (flag){
+                //System.out.println(i +"是质数");
+            }
+        }
+
+        long end = System.currentTimeMillis();
+
+        //时间
+        System.out.println(end - start);
+
+    }
+}

+ 66 - 0
JavaSE/day04/src/com/lc/day04/bc02/Test03.java

@@ -0,0 +1,66 @@
+package com.lc.day04.bc02;
+
+/**
+ * ClassName: Test02
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 9:30
+ * @Version 1.0
+ */
+public class Test03 {
+    /*
+    **题目:找出100以内所有的素数(质数)?100000以内的呢?**
+
+    目的:不同的代码的实现方式,可以效率差别很大。
+
+    分析:素数(质数):只能被1和它本身整除的自然数。  --->
+    从2开始,到这个数-1为止,此范围内没有这个数的约数。则此数是一个质数。
+    比如:2、3、5、7、11、13、17、19、23、...
+
+        3-100
+        3 取模  2
+        4 取模  2 3
+        5 取模  2 3 4
+        *
+
+        36 取模 2 - 6
+        100  取模  2 - 99
+        *
+
+        标志 判断
+
+        外循环 素数判断
+
+        内循环  素数条件
+     */
+    public static void main(String[] args) {
+        //时间
+        long start = System.currentTimeMillis();
+        // 1-100
+        for (int i = 3; i < 100000; i++) {
+            //标识
+            boolean flag = true;
+
+            //素数条件  i 开方
+            for (int j = 2; j <= Math.sqrt(i); j++) {
+                //取模 判断
+                if ( i % j == 0 ){
+                    //标识
+                    flag = false;
+                    // 停止
+                    break;
+                }
+            }
+            //判断
+            if (flag){
+                //System.out.println(i +"是质数");
+            }
+        }
+
+        long end = System.currentTimeMillis();
+
+        //时间
+        System.out.println(end - start);
+
+    }
+}

+ 27 - 0
JavaSE/day04/src/com/lc/day04/bc02/Test04.java

@@ -0,0 +1,27 @@
+package com.lc.day04.bc02;
+
+/**
+ * ClassName: Test04
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 9:59
+ * @Version 1.0
+ */
+public class Test04 {
+    //死循环
+    public static void main(String[] args) {
+
+        //死循环
+//        while (true){
+//            System.out.println("1");
+//        }
+
+        for (;true ; ) {
+            System.out.println("1");
+        }
+
+        //后面不能写代码
+        //System.out.println("123");
+    }
+
+}

+ 52 - 0
JavaSE/day04/src/com/lc/day04/exer01/Test01.java

@@ -0,0 +1,52 @@
+package com.lc.day04.exer01;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 10:49
+ * @Version 1.0
+ */
+public class Test01 {
+    /*
+    - 声明String数组,记录你最喜欢电影的名称最少5部。
+    - 声明String数组,记录你最喜欢的女演员 最少6位。
+    - 声明double数组,记录你最最近的体重状况 6天。
+    - 使用 下标查看第一个数组的 第2部电影
+    - 使用 下标查看第二个数组的 第3位演员
+    - 使用 下标查看第三个数组的 第4天的体重 输出
+    - 修改第一个数组 的第三部电影为  《志愿军:雄兵出击》
+    - 修改第二个数组 的最后一位为  徐帆
+     */
+    public static void main(String[] args) {
+
+        //数组的声明和初始化
+        String[] moves = {"灌篮高手","志愿军","长津湖","北纬38度","金刚川"};
+
+        String[] names = {"坤坤","峰峰","凡凡","赵丽颖","杨幂"};
+
+        double[] weight = {80.0,81.2,82.3,84.2,83.2};
+
+        //操作
+        //  长度  名称.length 数组的长度, 不可变。
+        // 下标   0 开始, 数组的长度 - 1 结束。
+        //       连续  每次 加1.
+        //  数组名[下标]
+        System.out.println(moves[1]);
+        System.out.println(names[2]);
+        System.out.println(weight[4]);
+
+        // 修改
+        moves[2] = "志愿军:雄兵出击";
+
+        // 最后一位 length
+        names[names.length - 1] = "徐帆";
+
+        System.out.println(moves[2]);
+        System.out.println(names[names.length - 1]);
+
+
+    }
+
+
+}

+ 76 - 0
JavaSE/day04/src/com/lc/day04/exer01/Test02.java

@@ -0,0 +1,76 @@
+package com.lc.day04.exer01;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 10:49
+ * @Version 1.0
+ */
+public class Test02 {
+    public static void main(String[] args) {
+        //求数组元素的最小值  索引位置
+        int[] arr = {101, 10, 29, 234, 2345, 64356, 123 , 10 , 10};
+
+        int min = arr[0];
+
+        //索引
+        String index = "";
+
+        for (int i = 0; i < arr.length; i++) {
+            if (arr[i] < min){
+                min = arr[i];
+
+                //索引
+                index = i+"";
+            }
+        }
+
+        System.out.println("索引:"+index +"最小值:"+min);
+
+    }
+
+    public static void main2(String[] args) {
+        //求数组元素的最大值
+        int[] arr = {1, 10, 29, 234, 2345, 64356, 123};
+
+        //定义数组的第一个
+        int max = arr[0];
+
+        //循环
+        for (int i = 0; i < arr.length; i++) {
+            //大于最大值替换
+            if (arr[i] > max){
+                //替换
+                max = arr[i];
+            }
+        }
+
+        System.out.println("最大值:"+max);
+
+
+    }
+
+    public static void main1(String[] args) {
+        //数组统计:求总和、均值
+        int[] arr = {1,10,29,234,2345,64356,123};
+
+        //标识 和
+        int sum = 0;
+
+        for (int i = 0; i < arr.length; i++) {
+            //加=
+            sum = sum + arr[i];
+        }
+
+        System.out.println("数组的和:"+sum);
+
+        //平均数
+        int i = sum / arr.length;
+        System.out.println("数组的平均值:"+i);
+
+
+    }
+
+
+}

+ 34 - 0
JavaSE/day04/src/com/lc/day04/exer01/Test03.java

@@ -0,0 +1,34 @@
+package com.lc.day04.exer01;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 10:49
+ * @Version 1.0
+ */
+public class Test03 {
+    public static void main(String[] args) {
+        //找最值及其所有最值的下标
+        int[] arr = {101, 12, 29, 234, 10 ,2345, 64356, 123, 10, 10};
+
+        //索引
+        String index = "";
+        //最小值
+        int min = arr[0];
+
+        for (int i = 0; i < arr.length; i++) {
+            if ( arr[i] < min ){
+                min = arr[i];
+                index = i+"";
+            }else if ( arr[i] == min ){
+                index += ","+i;
+            }
+        }
+
+        System.out.println("index:"+index);
+        System.out.println("min:"+min);
+    }
+
+
+}

+ 42 - 0
JavaSE/day04/src/com/lc/day04/exer01/Test04.java

@@ -0,0 +1,42 @@
+package com.lc.day04.exer01;
+
+/**
+ * ClassName: Test04
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 14:12
+ * @Version 1.0
+ */
+public class Test04 {
+    public static void main(String[] args) {
+        /*
+            数组 :和
+            最大子数组 : 和
+
+            数组和 比较  最大子数组
+                大于 替换
+                小于 0 舍弃
+         */
+
+        int[] arr = {1, -2, 3, 10, -4, 7, 2, -5};
+
+        int sum = 0;
+
+        int maxSum = 0;
+
+        for (int i = 0; i < arr.length; i++) {
+            //数组和
+            sum+=arr[i];
+            if (sum < 0){
+                sum = 0;
+            }
+
+            // 大于
+            if (sum > maxSum){
+                maxSum = sum;
+            }
+        }
+
+        System.out.println(maxSum);
+    }
+}

+ 95 - 0
JavaSE/day04/src/com/lc/day04/exer02/Test01.java

@@ -0,0 +1,95 @@
+package com.lc.day04.exer02;
+
+import java.util.Scanner;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 16:05
+ * @Version 1.0
+ */
+public class Test01 {
+
+    /*
+        准备内容
+     */
+    public static void main(String[] args) throws InterruptedException {
+        String[] hert = {
+                "你认为精神出轨和肉体出轨哪个比较严重?",
+            "因为什么事情,哭得特别难受?",
+            "哭得最伤心的是哪一次?为什么?",
+            "收到过最难忘的礼物是什么?",
+            "谁是你最崇拜的人?为什么?",
+            "早上吃什么?中午吃什么?晚上吃什么?",
+            "我们在一起你快乐吗?",
+            "有没有自己偷偷看过大片?",
+            "你现在还是单身吗?",
+            "你最想要的5样东西",
+            "裤是什么颜色?"
+        };
+
+        String[] adv = {
+                "原地转十圈然后靠一个人身上",
+                "把右边第一个横抱起来",
+                "挤出护手霜,帮最近的异性涂",
+                "随便抓个人说,我怀了你的孩子",
+                "右手捏住左耳垂,弯下腰,转十圈,再金鸡独立十秒",
+                "吃下每个人为你夹得菜",
+                "抱着正对面人的大腿唱情歌",
+                "选一个男生,锤他胸口,并说“你好厌恶哦”",
+                "学超级名模走秀绕场一周",
+                "想办法让指定的一名异性兴奋起来",
+        };
+
+        String[] person = {"琼月","虞彩","寒雁","琼霎","凤采","惠莹","依枝","雅蕾"};
+
+        //游戏开始
+        System.out.println("----------真心话大冒险游戏-------------");
+        //选人
+        int pIndex = (int) (Math.random()*person.length);
+
+        System.out.println("随机人员是:");
+        for (int i = 0; i < 3; i++) {
+            Thread.sleep(1000);
+            System.out.println((3-i));
+        }
+        //展示人员
+        System.out.println( person[pIndex] );
+
+        while (true){
+            System.out.println(" 选择 1真心话  2 大冒险");
+            Scanner scanner = new Scanner(System.in);
+
+            int i = scanner.nextInt();
+            if ( i != 1 && i != 2 ){
+                System.out.println("请输入 1 或者 2");
+            }
+
+            switch (i){
+                case 1:
+                    int hIndex = (int) (Math.random()*hert.length);
+                    System.out.println("内容是:");
+                    System.out.println();
+                    System.out.println(hert[hIndex]);
+                    break;
+                case 2:
+                    int aIndex = (int) (Math.random()*adv.length);
+                    System.out.println("内容是:");
+                    System.out.println();
+                    System.out.println(adv[aIndex]);
+                    break;
+            }
+
+            System.out.println("是否继续游戏");
+            System.out.println("1 继续  2 退出");
+            int num = scanner.nextInt();
+            if (num == 2){
+                break;
+            }
+        }
+
+
+    }
+
+}

+ 92 - 0
JavaSE/day04/src/com/lc/day04/exer02/Test02.java

@@ -0,0 +1,92 @@
+package com.lc.day04.exer02;
+
+import java.util.Arrays;
+import java.util.Scanner;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 16:05
+ * @Version 1.0
+ */
+public class Test02 {
+
+
+    public static void main(String[] args) throws InterruptedException {
+        int[] blueArr = new int[5];
+
+        for (int i = 0; i < blueArr.length; i++) {
+            //随机数
+            int random =(int)(Math.random() * 10)+1;
+            //赋值
+            blueArr[i] = random;
+            //比较
+            for (int k = 0; k < i; k++) {
+                if (blueArr[k] == random){
+                    i --;
+                    break;
+                }
+            }
+        }
+
+
+
+        int[] inputBlueArr = new int[5];
+        //输入
+        Scanner sc = new Scanner(System.in);
+        for (int i = 0; i < 5; i++) {
+            System.out.println("请输入第"+(i+1)+"个蓝球");
+            int num = sc.nextInt();
+
+            inputBlueArr[i] = num;
+            //比较
+            for (int k = 0; k < i; k++) {
+                if (inputBlueArr[k] == num){
+                    i --;
+                    System.out.println("请重新输入");
+                    break;
+                }
+            }
+        }
+
+        int redBall = (int)(Math.random() * 7)+1;
+        System.out.println("请输入红球");
+
+        int inputRedBall = sc.nextInt();
+
+        //比较
+        int count = 0;
+
+        for (int i = 0; i < blueArr.length; i++) {
+            for (int k = 0; k < inputBlueArr.length; k++) {
+                if ( blueArr[i] == inputBlueArr[k] ){
+                    count++;
+                }
+            }
+        }
+
+        if ( count == 5 && inputRedBall == redBall ){
+            System.out.println("一等奖");
+        }  else if ( count == 5  ){
+            System.out.println("二等奖");
+        }  else if ( count == 3 && inputRedBall == redBall ){
+            System.out.println("三等奖");
+        }  else if ( count == 3  ){
+            System.out.println("四等奖");
+        }  else if ( count == 2 && inputRedBall == redBall ){
+            System.out.println("五等奖");
+        }  else if ( count == 2 || inputRedBall == redBall ){
+            System.out.println("六等奖");
+        }  else {
+            System.out.println("遗憾");
+        }
+
+        System.out.println(Arrays.toString(blueArr));
+        System.out.println(Arrays.toString(inputBlueArr));
+
+        System.out.println("红:"+redBall+"-输入红球:"+inputRedBall);
+        System.out.println(count);
+    }
+
+}

+ 179 - 0
JavaSE/day04/src/com/lc/day04/exer02/Test03.java

@@ -0,0 +1,179 @@
+package com.lc.day04.exer02;
+
+import java.util.Scanner;
+
+/**
+ * ClassName: Test03
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/12 17:02
+ * @Version 1.0
+ */
+public class Test03 {
+
+
+        public static void main(String[] args) {int money;boolean play=true;
+            Scanner scanner=new Scanner(System.in);int getin;int bei;int _final;int ori;
+
+            System.out.println("你想要多少钱作为起始资金");
+            money=scanner.nextInt();
+
+            while(true) {
+                int get=0; ori=money;
+                System.out.println("输入你的下注以及基础倍率");
+                System.out.println("下注为");
+                int in = scanner.nextInt();
+                System.out.println("你还剩下"+(money-in)+"元");
+                while(true) {
+                    System.out.println("你要的基础倍率为(基础倍率每加1,入场费加五十,入场费的基础为100)");
+                    bei = scanner.nextInt();
+                    getin = 50 * bei;
+                    System.out.println("入场费为"+getin+"确定吗??(true or false)");
+                    boolean toopen=scanner.nextBoolean();
+                    if(toopen==false){
+                        continue;
+                    }
+                    System.out.println("输入完毕");
+                    break;
+                }
+                money=money-in-getin;
+                if(money<0)
+                {
+                    System.out.println("你的钱不够,不该来这里");
+                    continue;
+                }
+                System.out.println("你还剩下"+money+"元");
+                int[] input_1 = new int[5];
+                int input;
+                boolean judge = true;
+                System.out.println("输入五个红色球(1~36)");
+                while (true)
+                {
+                    for (int i = 0; i < 5; i++)
+                    {
+                        input_1[i] = scanner.nextInt();
+                        for(int j=0;j<i;j++)
+                        {
+                            if(input_1[i]==input_1[j])
+                            {
+                                judge=false;
+                                System.out.println("数据输入有误,请输入不重复的数据");
+                                break;
+                            }
+                        }
+                        if(input_1[i]>36||input_1[i]<=0)
+                        {
+                            judge=false;
+                            System.out.println("数据输入错误,重新输入(1~36)");
+                            break;
+                        }
+                        else if(input_1[i]>=0&&input_1[i]<=36)
+                        {
+                            if(4-i!=0)
+                                System.out.println("还需输入" + (4 - i) + "个");
+                            else if(4-i==0)
+                                System.out.println("输入完毕");
+                        }
+                    }
+                    if(judge==false)
+                    {
+                        judge=true;
+                        continue;
+                    }
+                    if(judge==true)
+                        break;
+                }
+
+
+
+
+                while(true){
+                    System.out.println("输入蓝球");
+                    input = scanner.nextInt();
+                    if(input>7) {
+                        System.out.println("重新输入");
+                        continue;
+                    }
+                    break;}
+                int[] output = new int[5];
+                for (int i = 0; i < 5; i++) {
+                    output[i] = (int) (Math.random() * 100) % 35 + 1;
+                    int r = output[i];
+                    for (int j = 0; j < i; j++)
+                        if (r == output[j]) {
+                            i--;
+                            break;
+                        }
+                }
+                int output_1 = (int) (Math.random() * 10) % 7 + 1;
+                int red = 0, blue = 0;
+                for (int i = 0; i < 5; i++) {
+                    for (int j = 0; j < 5; j++) {
+                        if (input_1[i] == output[j])
+                            red++;
+                    }
+                }
+                if (input == output_1)
+                    blue++;
+                System.out.println("开奖啦!!!");
+
+                System.out.println("红球即将出现!!!");
+
+                for(int i=0;i<5;i++)
+                {  System.out.print("第"+(i+1)+"个红球是---");
+                    try {
+                        Thread.sleep(1000);
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();
+                    }
+                    System.out.println(output[i]+" ");
+                }
+                System.out.println("你猜的是");
+                for(int i=0;i<5;i++) {
+
+                    System.out.print(input_1[i]);
+                }
+                System.out.println("蓝球即将揭晓!!");try {
+                    Thread.sleep(2000);
+                } catch (InterruptedException e) {
+                    e.printStackTrace();
+                }
+                if(blue==1)
+                    System.out.println(output_1+"你猜对啦!!!!");
+                else if(blue==0)
+                    System.out.println("很遗憾,蓝球是"+output_1+"而你猜的是"+input);
+                System.out.println("你猜对了"+"red"+"个红球");
+                if (red >= 2) {
+                    for (int i = 0; i < red; i++)
+                        bei *= 200;
+                    if (blue == 1)
+                        bei *= 5000;
+                    get = in * bei;
+                    money = money+ get;
+
+                } else if(red<2)
+                    ;
+                if(ori-money<0)
+                    System.out.println("你挣了"+(money-ori)+"元");
+                else if(ori-money>0)
+                    System.out.println("你亏了"+(ori-money)+"元");
+                System.out.println("你现在还有" + money + "元");
+                if(money<0)
+                    break;
+                else
+                {
+                    System.out.println("继续玩吗??(true/false)");
+                    play = scanner.nextBoolean();
+                    if (play == false)
+                        break;
+                }
+
+            }
+            System.out.println("游戏结束,你最终有"+money+"元");
+
+
+
+        }
+
+
+}

+ 6 - 0
JavaSe01/day01/HelloWorld.java

@@ -0,0 +1,6 @@
+public class HelloWorld {
+    public static void main( String[] args ){
+    	System.out.println("HelloWorld");
+    }
+    //中文
+}