xerga 2 年之前
父節點
當前提交
51faf1009d
共有 69 個文件被更改,包括 2205 次插入0 次删除
  1. 二進制
      00-Tools/03-集成开发环境-IDEA.zip
  2. 8 0
      01-JavaSe/.idea/.gitignore
  3. 6 0
      01-JavaSe/.idea/encodings.xml
  4. 6 0
      01-JavaSe/.idea/misc.xml
  5. 9 0
      01-JavaSe/.idea/modules.xml
  6. 10 0
      01-JavaSe/.idea/runConfigurations.xml
  7. 6 0
      01-JavaSe/.idea/vcs.xml
  8. 14 0
      01-JavaSe/01-JavaSe.iml
  9. 二進制
      01-JavaSe/day04/TestDoWhile01.class
  10. 40 0
      01-JavaSe/day04/TestDoWhile01.java
  11. 40 0
      01-JavaSe/day04/TestDoWhile01.java.bak
  12. 二進制
      01-JavaSe/day04/TestDoWhile04Ex.class
  13. 57 0
      01-JavaSe/day04/TestDoWhile04Ex.java
  14. 57 0
      01-JavaSe/day04/TestDoWhile04Ex.java.bak
  15. 二進制
      01-JavaSe/day04/TestFor01.class
  16. 25 0
      01-JavaSe/day04/TestFor01.java
  17. 19 0
      01-JavaSe/day04/TestFor01.java.bak
  18. 二進制
      01-JavaSe/day04/TestFor02.class
  19. 74 0
      01-JavaSe/day04/TestFor02.java
  20. 79 0
      01-JavaSe/day04/TestFor02.java.bak
  21. 二進制
      01-JavaSe/day04/TestSwitch01.class
  22. 36 0
      01-JavaSe/day04/TestSwitch01.java
  23. 37 0
      01-JavaSe/day04/TestSwitch01.java.bak
  24. 二進制
      01-JavaSe/day04/TestSwitch02.class
  25. 43 0
      01-JavaSe/day04/TestSwitch02.java
  26. 42 0
      01-JavaSe/day04/TestSwitch02.java.bak
  27. 二進制
      01-JavaSe/day04/TestSwitch03.class
  28. 28 0
      01-JavaSe/day04/TestSwitch03.java
  29. 29 0
      01-JavaSe/day04/TestSwitch03.java.bak
  30. 二進制
      01-JavaSe/day04/TestSwitch04.class
  31. 47 0
      01-JavaSe/day04/TestSwitch04.java
  32. 47 0
      01-JavaSe/day04/TestSwitch04.java.bak
  33. 二進制
      01-JavaSe/day04/TestSwitch05.class
  34. 74 0
      01-JavaSe/day04/TestSwitch05.java
  35. 75 0
      01-JavaSe/day04/TestSwitch05.java.bak
  36. 二進制
      01-JavaSe/day04/TestSwitch06Ex.class
  37. 56 0
      01-JavaSe/day04/TestSwitch06Ex.java
  38. 56 0
      01-JavaSe/day04/TestSwitch06Ex.java.bak
  39. 二進制
      01-JavaSe/day04/TestWhile01.class
  40. 39 0
      01-JavaSe/day04/TestWhile01.java
  41. 39 0
      01-JavaSe/day04/TestWhile01.java.bak
  42. 二進制
      01-JavaSe/day04/TestWhile03Ex.class
  43. 91 0
      01-JavaSe/day04/TestWhile03Ex.java
  44. 91 0
      01-JavaSe/day04/TestWhile03Ex.java.bak
  45. 21 0
      01-JavaSe/day05/day05.iml
  46. 40 0
      01-JavaSe/day05/src/com/lovecoding/day05/Test04.java
  47. 63 0
      01-JavaSe/day05/src/com/lovecoding/day05/TestBreakContniue03.java
  48. 113 0
      01-JavaSe/day05/src/com/lovecoding/day05/TestForForLoop02.java
  49. 34 0
      01-JavaSe/day05/src/com/lovecoding/day05/TestLoop01.java
  50. 50 0
      01-JavaSe/day05/src/com/lovecoding/day05/ex/TestForEx01.java
  51. 73 0
      01-JavaSe/day05/src/com/lovecoding/day05/ex/TestForEx02.java
  52. 21 0
      01-JavaSe/day06/day06.iml
  53. 73 0
      01-JavaSe/day06/src/com/lovecoding/day06/TestArr01.java
  54. 22 0
      01-JavaSe/day06/src/com/lovecoding/day06/TestArr02.java
  55. 30 0
      01-JavaSe/day06/src/com/lovecoding/day06/TestArr03.java
  56. 27 0
      01-JavaSe/day06/src/com/lovecoding/day06/TestArr03m2.java
  57. 28 0
      01-JavaSe/day06/src/com/lovecoding/day06/TestArr03m3.java
  58. 41 0
      01-JavaSe/day06/src/com/lovecoding/day06/TestArrArr04.java
  59. 34 0
      01-JavaSe/day06/src/com/lovecoding/day06/TestArrArr05.java
  60. 50 0
      01-JavaSe/day06/src/com/lovecoding/day06/TestArrArr06.java
  61. 31 0
      01-JavaSe/day06/src/com/lovecoding/day06/TestArrArr07.java
  62. 124 0
      01-JavaSe/day06/src/com/lovecoding/day06/TestArrEx01.java
  63. 50 0
      01-JavaSe/day06/src/com/lovecoding/day06/TestArrEx02.java
  64. 二進制
      01-JavaSe/out/production/day05/com/lovecoding/day05/Test04.class
  65. 二進制
      01-JavaSe/out/production/day05/com/lovecoding/day05/TestBreakContniue03.class
  66. 二進制
      01-JavaSe/out/production/day05/com/lovecoding/day05/TestForForLoop02.class
  67. 二進制
      01-JavaSe/out/production/day05/com/lovecoding/day05/TestLoop01.class
  68. 二進制
      01-JavaSe/out/production/day05/com/lovecoding/day05/ex/TestForEx01.class
  69. 二進制
      01-JavaSe/out/production/day05/com/lovecoding/day05/ex/TestForEx02.class

二進制
00-Tools/03-集成开发环境-IDEA.zip


+ 8 - 0
01-JavaSe/.idea/.gitignore

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

+ 6 - 0
01-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
01-JavaSe/.idea/misc.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectRootManager">
+    <output url="file://$PROJECT_DIR$/out" />
+  </component>
+</project>

+ 9 - 0
01-JavaSe/.idea/modules.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/01-JavaSe.iml" filepath="$PROJECT_DIR$/01-JavaSe.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day05/day05.iml" filepath="$PROJECT_DIR$/day05/day05.iml" />
+    </modules>
+  </component>
+</project>

+ 10 - 0
01-JavaSe/.idea/runConfigurations.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RunConfigurationProducerService">
+    <option name="ignoredProducers">
+      <set>
+        <option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
+      </set>
+    </option>
+  </component>
+</project>

+ 6 - 0
01-JavaSe/.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
+  </component>
+</project>

+ 14 - 0
01-JavaSe/01-JavaSe.iml

@@ -0,0 +1,14 @@
+<?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$/day01" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/day02" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/day03" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/day04" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

二進制
01-JavaSe/day04/TestDoWhile01.class


+ 40 - 0
01-JavaSe/day04/TestDoWhile01.java

@@ -0,0 +1,40 @@
+class TestDoWhile01 
+{
+	public static void main(String[] args) 
+	{
+		//遍历1-100的偶数,并计算所有偶数的和、偶数的个数(累加的思想)
+		int sum = 0;
+		int count = 0;
+		int k = 0;
+
+		do{
+			//循环体
+			if( k % 2 ==0 ){
+				count++;
+				sum+=k;
+			}
+			//迭代
+			k++;
+
+		}
+		while (k <= 100);
+
+		System.out.println("偶数的总和为:" + sum);
+		System.out.println("偶数的个数为:" + count);
+
+		System.out.println("---------------");
+
+		do{
+			System.out.println("执行一次");
+		}
+		while (false);
+
+		boolean b = false;
+
+		while (b){
+			System.out.println("执行一次");
+		}
+
+
+	}
+}

+ 40 - 0
01-JavaSe/day04/TestDoWhile01.java.bak

@@ -0,0 +1,40 @@
+class TestDoWhile01 
+{
+	public static void main(String[] args) 
+	{
+		//遍历1-100的偶数,并计算所有偶数的和、偶数的个数(累加的思想)
+		int sum = 0;
+		int count = 0;
+		int k = 0;
+
+		do{
+			//循环体
+			if( k % 2 ==0 ){
+				count++;
+				sum+=k;
+			}
+			//迭代
+			k++;
+
+		}
+		while (k <= 100);
+
+		System.out.println("偶数的总和为:" + sum);
+		System.out.println("偶数的个数为:" + count);
+
+		System.out.println("---------------");
+
+		do{
+			System.out.println("执行一次");
+		}
+		while (false);
+
+		boolean b = false;
+
+		while (){
+			System.out.println("执行一次");
+		}
+
+
+	}
+}

二進制
01-JavaSe/day04/TestDoWhile04Ex.class


+ 57 - 0
01-JavaSe/day04/TestDoWhile04Ex.java

@@ -0,0 +1,57 @@
+import java.util.*;
+class TestDoWhile04Ex 
+{
+	public static void main(String[] args) 
+	{
+		//**案例3:ATM取款**
+		/*
+		声明变量balance并初始化为0,用以表示银行账户的余额,下面通过ATM机程序实现存款,取款等功能。
+
+		=========ATM========
+		   1、存款
+		   2、取款
+		   3、显示余额
+		   4、退出
+		请选择(1-4):
+		*/
+		double money = 1000.0;
+
+		Scanner sc = new Scanner(System.in);
+		int s = 1;
+
+		while (s != 4){
+			System.out.println("=========ATM========");
+			System.out.println("1、存款");
+			System.out.println("2、取款");
+			System.out.println("3、显示余额");
+			System.out.println("4、退出");
+
+			System.out.println("请选择(1-4):");
+
+			s = sc.nextInt();
+
+			switch (s){
+				case 1:
+					System.out.println("请输入存款金额");
+					double m1 = sc.nextDouble();
+					money +=m1;
+					System.out.println("存款:"+m1);
+				break;
+
+				case 2:
+					System.out.println("请输入取款金额");
+					double m2 = sc.nextDouble();
+					money -=m2;
+					System.out.println("取款"+m2);
+				break;
+
+				case 3:
+					System.out.println("余额:"+money);
+				break;
+			
+			}
+		}
+		System.out.println("退出:"+money);
+		
+	}
+}

+ 57 - 0
01-JavaSe/day04/TestDoWhile04Ex.java.bak

@@ -0,0 +1,57 @@
+import java.util.*;
+class TestDoWhile04Ex 
+{
+	public static void main(String[] args) 
+	{
+		//**案例3:ATM取款**
+		/*
+		声明变量balance并初始化为0,用以表示银行账户的余额,下面通过ATM机程序实现存款,取款等功能。
+
+		=========ATM========
+		   1、存款
+		   2、取款
+		   3、显示余额
+		   4、退出
+		请选择(1-4):
+		*/
+		double money = 1000.0;
+
+		Scanner sc = new Scanner(System.in);
+		int s = 1;
+
+		while (s != 4){
+			System.out.println("=========ATM========");
+			System.out.println("1、存款");
+			System.out.println("2、取款");
+			System.out.println("3、显示余额");
+			System.out.println("4、退出");
+
+			System.out.println("请选择(1-4):");
+
+			s = sc.nextInt();
+
+			switch (s){
+				case 1:
+					System.out.println("请输入存款金额");
+					double m1 = sc.nextDouble();
+					money +=m1;
+					System.out.println("存款:"+m1);
+				break;
+
+				case 2:
+					System.out.println("请输入取款金额");
+					double m2 = sc.nextDouble();
+					money -=m2;
+					System.out.println("存款"+m2);
+				break;
+
+				case 3:
+					System.out.println("余额:"+money);
+				break;
+			
+			}
+		}
+		System.out.println("退出:"+money);
+		
+	}
+}

二進制
01-JavaSe/day04/TestFor01.class


+ 25 - 0
01-JavaSe/day04/TestFor01.java

@@ -0,0 +1,25 @@
+class TestFor01
+{
+	public static void main(String[] args) 
+	{
+		//使用for循环重复执行某些语句 输出5行HelloWorld
+
+		//格式
+		// int i = 0 初始化
+		// i<5  条件
+		// System.out.println("HelloWorld"); 循环体
+		// i++ 迭代
+		
+		for( int i = 0 , j = 1; i<5 ; i++ , j--  ){
+			
+			System.out.println("HelloWorld");
+		}
+
+
+        int num = 1;
+        //初始化
+        for(System.out.print("a");num < 3;System.out.print("c"),num++){
+            System.out.print("b");
+        }
+	}
+}

+ 19 - 0
01-JavaSe/day04/TestFor01.java.bak

@@ -0,0 +1,19 @@
+class TestFor01
+{
+	public static void main(String[] args) 
+	{
+		//使用for循环重复执行某些语句 输出5行HelloWorld
+
+		//格式
+		// int i = 0 初始化
+		// i<5  条件
+		// System.out.println("HelloWorld"); 循环体
+		// i++ 迭代
+		
+		for( int i = 0 , j = 1; i<5 ; i++ , j--  ){
+			
+			System.out.println("HelloWorld");
+		}
+
+	}
+}

二進制
01-JavaSe/day04/TestFor02.class


+ 74 - 0
01-JavaSe/day04/TestFor02.java

@@ -0,0 +1,74 @@
+class TestFor02 
+{
+	public static void main(String[] args) 
+	{
+		//TestFor01
+		//遍历1-100以内的偶数,并获取偶数的个数,获取所有的偶数的和
+		int sum =0;
+
+		for (int i = 1;i <= 100 ; i++ ){
+			//偶数
+			if( i % 2 == 0 ){
+				//sum = sum + i;
+				sum += i;
+			}
+		}
+
+		System.out.println("偶数的和:"+sum);
+
+
+		//输出所有的水仙花数,所谓水仙花数是指一个3位数,
+		//其各个位上数字立方和等于其本身。例如: `153 = 1*1*1 + 3*3*3 + 5*5*5`
+		//特点: 3位数 100 - 999
+
+		for (int i = 100; i<1000 ; 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);
+			}
+		}
+
+
+		//说明:输入两个正整数m和n,求其最大公约数和最小公倍数。
+		//比如:12和20的最大公约数是4,最小公倍数是60。
+
+		// 开始 和 结束  
+		
+		// 12和20的最大公约数是4,最小公倍数是60。
+		// 12 ---  12 % i 20 % i  == 0  
+
+		int m = 12;
+		int n = 20;
+
+		int min = m < n ? m : n; 
+
+		for ( int i = min ; i >= 1  ; i-- ){ 
+			if ( m % i ==0 && n % i == 0  ){
+				System.out.println("最大公约数是:"+i);
+				break;
+			}
+		}
+
+		// 开始 和 结束 
+		//比如:12和20的最大公约数是4,最小公倍数是60。
+
+		// 20  12*20;
+		int max = m > n ? m : n; 
+
+		for (int i = max; i <= m*n ;i++ ){
+			if ( i % m == 0 && i % n == 0 ){
+				System.out.println("最小公倍数是:"+i);
+				break;
+			}
+		}
+
+
+
+
+
+	}
+}

+ 79 - 0
01-JavaSe/day04/TestFor02.java.bak

@@ -0,0 +1,79 @@
+class TestFor02 
+{
+	public static void main(String[] args) 
+	{
+		//TestFor01
+		//遍历1-100以内的偶数,并获取偶数的个数,获取所有的偶数的和
+		int sum =0;
+
+		for (int i = 1;i <= 100 ; i++ ){
+			//偶数
+			if( i % 2 == 0 ){
+				//sum = sum + i;
+				sum += i;
+			}
+		}
+
+		System.out.println("偶数的和:"+sum);
+
+
+		//输出所有的水仙花数,所谓水仙花数是指一个3位数,
+		//其各个位上数字立方和等于其本身。例如: `153 = 1*1*1 + 3*3*3 + 5*5*5`
+		//特点: 3位数 100 - 999
+
+		for (int i = 100; i<1000 ; 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);
+			}
+		}
+
+
+		//说明:输入两个正整数m和n,求其最大公约数和最小公倍数。
+		//比如:12和20的最大公约数是4,最小公倍数是60。
+
+		// 开始 和 结束  
+		
+		// 12和20的最大公约数是4,最小公倍数是60。
+		// 12 ---  12 % i 20 % i  == 0  
+
+		int m = 12;
+		int n = 20;
+
+		int min = m < n ? m : n; 
+
+		for ( int i = min ; i >= 1  ; i-- ){ 
+			if ( m % i ==0 && n % i == 0  ){
+				System.out.println("最大公约数是:"+i);
+				break;
+			}
+		}
+
+		// 开始 和 结束 
+		//比如:12和20的最大公约数是4,最小公倍数是60。
+
+		// 20  12*20;
+		int max = m > n ? m : n; 
+
+		for (int i = max; i <= m*n ;i++ ){
+			if ( i % m == 0 && i % n == 0 ){
+				System.out.println("最小公倍数是:"+i);
+				break;
+			}
+		}
+
+
+
+
+
+
+
+
+
+
+	}
+}

二進制
01-JavaSe/day04/TestSwitch01.class


+ 36 - 0
01-JavaSe/day04/TestSwitch01.java

@@ -0,0 +1,36 @@
+class TestSwitch01 
+{
+	public static void main(String[] args) 
+	{
+		//switch
+		//语法
+		String m = "苹果";
+		//格式
+		switch(m){
+
+			default:
+				System.out.println("面头");
+			
+			case "面条":
+				System.out.println("面条");
+			
+			case "米饭":
+				System.out.println("米饭");
+			break;
+
+			case "米线":
+				System.out.println("面条");
+			break;
+		
+		}
+
+		//注意
+		// case 匹配值 char byte short int String 枚举 enum
+		// case 穿透性 
+
+		//使用上 if语句对比
+		// 常量值 使用 switch
+		// 范围性的 if else 
+
+	}
+}

+ 37 - 0
01-JavaSe/day04/TestSwitch01.java.bak

@@ -0,0 +1,37 @@
+class TestSwitch01 
+{
+	public static void main(String[] args) 
+	{
+		//switch
+		//语法
+		String m = "苹果";
+		//格式
+		switch(m){
+
+			default:
+				System.out.println("面头");
+			
+
+			case "面条":
+				System.out.println("面条");
+			
+			case "米饭":
+				System.out.println("米饭");
+			break;
+
+			case "米线":
+				System.out.println("面条");
+			break;
+		
+		}
+
+		//注意
+		// case 匹配值 char byte short int String 枚举 enum
+		// case 穿透性 
+
+		//使用上 if语句对比
+		// 常量值 使用 switch
+		// 范围性的 if else 
+
+	}
+}

二進制
01-JavaSe/day04/TestSwitch02.class


+ 43 - 0
01-JavaSe/day04/TestSwitch02.java

@@ -0,0 +1,43 @@
+import java.util.*;
+
+class TestSwitch02
+{
+	public static void main(String[] args) 
+	{
+		//根据输入数字输出英文
+		Scanner sc = new Scanner(System.in);
+		//数字
+		System.out.println("输入数字123");
+		//调用方法
+		int number =  sc.nextInt();
+		
+		//判断
+		//switch
+		switch(number){
+			case 1:
+				System.out.println("one");
+			break;
+			case 2:
+				System.out.println("two");
+			break;
+			case 3:
+				System.out.println("three");
+			break;
+			default:
+				System.out.println("error");
+			break;
+		
+		}
+
+		//关闭
+		sc.close();
+		
+
+		//使用switch-case实现:对学生成绩大于60分的,输出“合格”。低于60分的,输出“不合格”。
+		//不能if 
+		//单个值 case 1 - 60  >  68 6  除以60 和 1 比较 
+
+
+
+	}
+}

+ 42 - 0
01-JavaSe/day04/TestSwitch02.java.bak

@@ -0,0 +1,42 @@
+import java.util.*;
+
+class TestSwitch02
+{
+	public static void main(String[] args) 
+	{
+		//根据输入数字输出英文
+		Scanner sc = new Scanner(System.in);
+		//数字
+		System.out.println("输入数字123");
+		//调用方法
+		int number =  sc.nextInt();
+		
+		//判断
+		//switch
+		switch(number){
+			case 1:
+				System.out.println("one");
+			break;
+			case 2:
+				System.out.println("two");
+			break;
+			case 3:
+				System.out.println("three");
+			break;
+			default:
+				System.out.println("error");
+			break;
+		
+		}
+
+		//关闭
+		sc.close();
+		
+
+		//使用switch-case实现:对学生成绩大于60分的,输出“合格”。低于60分的,输出“不合格”。
+		//不能if 
+		//单个值 case 1 - 60  >  68 6  除以60 和 1 比较 
+
+
+	}
+}

二進制
01-JavaSe/day04/TestSwitch03.class


+ 28 - 0
01-JavaSe/day04/TestSwitch03.java

@@ -0,0 +1,28 @@
+class TestSwitch03 
+{
+	public static void main(String[] args) 
+	{
+		//
+		//使用switch-case实现:对学生成绩大于60分的,输出“合格”。低于60分的,输出“不合格”。
+		//不能if 
+		//单个值 case 1 - 60  >  68 6  除以60 和 1 比较
+
+		int s = 101;
+		//范围
+		if( s >= 0 && s <=100 ){
+			switch (s/60){
+				case 1:
+					System.out.println("合格");
+				break;
+				default:
+					System.out.println("不合格");
+				break;
+			}
+		}else{
+			System.out.println("分数非法");
+		}
+
+	
+		
+	}
+}

+ 29 - 0
01-JavaSe/day04/TestSwitch03.java.bak

@@ -0,0 +1,29 @@
+class TestSwitch03 
+{
+	public static void main(String[] args) 
+	{
+		//
+		//使用switch-case实现:对学生成绩大于60分的,输出“合格”。低于60分的,输出“不合格”。
+		//不能if 
+		//单个值 case 1 - 60  >  68 6  除以60 和 1 比较
+
+		int s = 101;
+		//范围
+		if( s >= 0 && s <=100 ){
+			switch (s/60){
+				case 1:
+					System.out.println("合格");
+				break;
+				default:
+					System.out.println("不合格");
+				break;
+			}
+		}else{
+			System.out.println("分数非法");
+		}
+
+		
+
+		
+	}
+}

二進制
01-JavaSe/day04/TestSwitch04.class


+ 47 - 0
01-JavaSe/day04/TestSwitch04.java

@@ -0,0 +1,47 @@
+class TestSwitch04 
+{
+	public static void main(String[] args) 
+	{
+		//编写程序:从键盘上输入2023年的“month”和“day”,要求通过程序输出输入的日期为2023年的第几天。
+		//在switch语句中,如果case的后面不写break,将出现穿透现象,
+		//也就是一旦匹配成功,不会在判断下一个case的值,直接向后运行,
+		//直到遇到break或者整个switch语句结束,执行终止。
+		
+		int month = 6; //前5个月
+
+		int day = 12; 
+
+		//求和思想
+		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("2023年的"+month+"和"+day+"是第:"+days);
+	}
+}

+ 47 - 0
01-JavaSe/day04/TestSwitch04.java.bak

@@ -0,0 +1,47 @@
+class TestSwitch04 
+{
+	public static void main(String[] args) 
+	{
+		//编写程序:从键盘上输入2023年的“month”和“day”,要求通过程序输出输入的日期为2023年的第几天。
+		//在switch语句中,如果case的后面不写break,将出现穿透现象,
+		//也就是一旦匹配成功,不会在判断下一个case的值,直接向后运行,
+		//直到遇到break或者整个switch语句结束,执行终止。
+		
+		int month = 6; //前5个月
+
+		int day = 12; 
+
+		//求和思想
+		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:
+				day += 31;
+			case 3:
+				day += 28;
+			case 2:
+				days += 31;
+			case 1:
+				days += day;
+			
+		}
+
+		System.out.println("2023年的"+month+"和"+day+"是第:"+days);
+	}
+}

二進制
01-JavaSe/day04/TestSwitch05.class


+ 74 - 0
01-JavaSe/day04/TestSwitch05.java

@@ -0,0 +1,74 @@
+import java.util.*;
+
+class TestSwitch05 
+{
+	public static void main(String[] args) 
+	{
+		/*
+		从键盘分别输入年、月、日,判断这一天是当年的第几天
+ 
+		注:判断一年是否是闰年的标准:
+		   1)可以被4整除,但不可被100整除
+			  或
+		   2)可以被400整除
+		   
+		例如:1900,2200等能被4整除,但同时能被100整除,但不能被400整除,不是闰年
+		*/
+		
+		Scanner sc = new Scanner(System.in);
+		//数字
+		System.out.println("输入年份");
+		//调用方法
+		int year =  sc.nextInt();
+		System.out.println("输入月份");
+		//调用方法
+		int month =  sc.nextInt();
+		System.out.println("输入天数");
+		//调用方法
+		int day =  sc.nextInt();
+
+		//求和思想
+		int days = 0;
+
+		if(year > 0){
+			if(month >=1 && month <= 12){
+				//天数判断
+
+				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;
+						//判断闰年
+						if( year % 4 == 0 && year %100 != 0 || year % 400 ==0 ){
+							days++;
+						}
+
+					case 2:
+						days += 31;
+					case 1:
+						days += day;
+					
+				}
+
+				System.out.println("2023年的"+month+"和"+day+"是第:"+days);
+			}
+		}
+	}
+}

+ 75 - 0
01-JavaSe/day04/TestSwitch05.java.bak

@@ -0,0 +1,75 @@
+import java.util.*;
+
+class TestSwitch05 
+{
+	public static void main(String[] args) 
+	{
+		/*
+		从键盘分别输入年、月、日,判断这一天是当年的第几天
+ 
+		注:判断一年是否是闰年的标准:
+		   1)可以被4整除,但不可被100整除
+			  或
+		   2)可以被400整除
+		   
+		例如:1900,2200等能被4整除,但同时能被100整除,但不能被400整除,不是闰年
+		*/
+		
+		Scanner sc = new Scanner(System.in);
+		//数字
+		System.out.println("输入年份");
+		//调用方法
+		int year =  sc.nextInt();
+		System.out.println("输入月份");
+		//调用方法
+		int month =  sc.nextInt();
+		System.out.println("输入天数");
+		//调用方法
+		int day =  sc.nextInt();
+
+		//求和思想
+		int days = 0;
+
+		if(year > 0){
+			if(month >=1 && month <= 12){
+				//天数判断
+
+				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;
+						//判断闰年
+						if( year % 4 == 0 && year %100 != 0 || year % 400 ==0 ){
+							days++;
+						}
+
+					case 2:
+						days += 31;
+					case 1:
+						days += day;
+					
+				}
+
+				System.out.println("2023年的"+month+"和"+day+"是第:"+days);
+
+			}
+		}
+	}
+}

二進制
01-JavaSe/day04/TestSwitch06Ex.class


+ 56 - 0
01-JavaSe/day04/TestSwitch06Ex.java

@@ -0,0 +1,56 @@
+import java.util.*;
+
+class TestSwitch06Ex 
+{
+	public static void main(String[] args) 
+	{
+
+		/* 
+		随机产生3个1-6的整数,如果三个数相等,那么称为“豹子”,如果三个数之和大于9,称为“大”,如果三个数之和小于等于9,称为“小”,用户从键盘输入押的是“豹子”、“大”、“小”,并判断是否猜对了
+
+		提示:随机数  Math.random()产生 [0,1)范围内的小数
+			如何获取[a,b]范围内的随机整数呢?(int)(Math.random() *a) + b
+		
+		*/
+
+		//随机数
+		int a = (int)(Math.random() *5) + 1;
+		int b = (int)(Math.random() *5) + 1;
+		int c = (int)(Math.random() *5) + 1;
+
+		//标志位
+		boolean flag = false;
+
+		Scanner sc = new Scanner(System.in);
+		//数字
+		System.out.println("输入“豹子”, “大”,“小”");
+		
+		String str =  sc.next();
+		//判断合理性
+		
+		switch(str){
+			case "豹子":
+				if (a == b && b == c ){
+					flag = true;
+				}
+			break;
+			case "大":
+				if ((a + b + c) > 9 ){
+					flag = true;
+				}
+			break;
+			case "小":
+				if ((a + b + c) < 9 ){
+					flag = true;
+				}
+			break;
+		}
+
+		if (flag){
+			System.out.println("abc="+a+"-"+b+"-"+c+":猜对了");
+		}else{
+			System.out.println("abc="+a+"-"+b+"-"+c+":猜错了");
+		}
+
+	}
+}

+ 56 - 0
01-JavaSe/day04/TestSwitch06Ex.java.bak

@@ -0,0 +1,56 @@
+import java.util.*;
+
+class TestSwitch06Ex 
+{
+	public static void main(String[] args) 
+	{
+
+		/* 
+		随机产生3个1-6的整数,如果三个数相等,那么称为“豹子”,如果三个数之和大于9,称为“大”,如果三个数之和小于等于9,称为“小”,用户从键盘输入押的是“豹子”、“大”、“小”,并判断是否猜对了
+
+		提示:随机数  Math.random()产生 [0,1)范围内的小数
+			如何获取[a,b]范围内的随机整数呢?(int)(Math.random() *a) + b
+		
+		*/
+
+		//随机数
+		int a = (int)(Math.random() *5) + 1;
+		int b = (int)(Math.random() *5) + 1;
+		int c = (int)(Math.random() *5) + 1;
+
+		//标志位
+		boolean flag = false;
+
+		Scanner sc = new Scanner(System.in);
+		//数字
+		System.out.println("输入“豹子”, “大”,“小”");
+		
+		String str =  sc.next();
+		//判断合理性
+		
+		switch(str){
+			case "豹子":
+				if (a && b && b == c ){
+					flag = true;
+				}
+			break;
+			case "大":
+				if ((a + b + c) > 9 ){
+					flag = true;
+				}
+			break;
+			case "小":
+				if ((a + b + c) < 9 ){
+					flag = true;
+				}
+			break;
+		}
+
+		if (flag){
+			System.out.println("abc="+a+"-"+b+"-"+c+":猜对了");
+		}else{
+			System.out.println("abc="+a+"-"+b+"-"+c+":猜错了");
+		}
+
+	}
+}

二進制
01-JavaSe/day04/TestWhile01.class


+ 39 - 0
01-JavaSe/day04/TestWhile01.java

@@ -0,0 +1,39 @@
+class TestWhile01 
+{
+	public static void main(String[] args) 
+	{
+		//输出5行HelloWorld!
+		// 初始化
+		int i = 0;
+
+		//条件判断
+		while(i < 5){
+			//循环体
+			System.out.println("Hello World!");
+			
+			//迭代
+			i++;
+		}
+
+		//遍历1-100的偶数,并计算所有偶数的和、偶数的个数(累加的思想)
+		int sum = 0;
+		int count = 0;
+
+		int k = 1;
+
+		//条件判断
+		while(k <= 100){
+			//循环体
+			if( k % 2 ==0 ){
+				count++;
+				sum+=k;
+			}
+			//迭代
+			k++;
+		}
+
+		System.out.println("和"+sum);
+		System.out.println("个"+count);
+		
+	}
+}

+ 39 - 0
01-JavaSe/day04/TestWhile01.java.bak

@@ -0,0 +1,39 @@
+class TestWhile01 
+{
+	public static void main(String[] args) 
+	{
+		//输出5行HelloWorld!
+		// 初始化
+		int i = 0;
+
+		//条件判断
+		while(i < 5){
+			//循环体
+			System.out.println("Hello World!");
+			
+			//迭代
+			i++;
+		}
+
+		//遍历1-100的偶数,并计算所有偶数的和、偶数的个数(累加的思想)
+		int sum = 0;
+		int count = 0;
+
+		int k = 1;
+
+		//条件判断
+		while(k <= 100){
+			//循环体
+			if( k % 2 ==0 ){
+				count++;
+				sum+=k;
+			}
+			//迭代
+			i++;
+		}
+
+		System.out.println("和"+sum);
+		System.out.println("个"+count);
+		
+	}
+}

二進制
01-JavaSe/day04/TestWhile03Ex.class


+ 91 - 0
01-JavaSe/day04/TestWhile03Ex.java

@@ -0,0 +1,91 @@
+import java.util.*;
+
+class  TestWhile03Ex
+{
+	public static void main(String[] args) 
+	{
+		/*
+		随机生成一个100以内的数,猜这个随机数是多少?
+
+		从键盘输入数,如果大了,提示大了;如果小了,提示小了;如果对了,
+		就不再猜了,并统计一共猜了多少次。
+
+		提示:生成一个[a,b] 范围的随机数的方式:(int)(Math.random() * (b - a + 1) + a)
+		
+		Scanner sc = new Scanner(System.in);
+
+		// while 
+		int number = (int) (Math.random()*101);
+		System.out.println("输入数字");
+		// 猜数字
+		int guess = sc.nextInt();
+
+		while ( number != guess  ){
+			//判断提示
+			if ( guess > number ){
+				System.out.println("大了");
+			}else{
+				System.out.println("小了");
+			}
+			//在输入
+			System.out.println("输入数字");
+			guess = sc.nextInt();
+		}
+
+		System.out.println("猜对了"+number);
+
+		
+
+		Scanner sc = new Scanner(System.in);
+
+		// while 
+		int number = (int) (Math.random()*101);
+		System.out.println("输入数字");
+		// 猜数字
+		int guess = sc.nextInt();
+		do{
+			//判断提示
+			if ( guess > number ){
+				System.out.println("大了");
+			}else{
+				System.out.println("小了");
+			}
+			//在输入
+			System.out.println("输入数字");
+			guess = sc.nextInt();
+		}while(number != guess);
+
+		System.out.println("猜对了"+number);
+
+		*/
+
+				Scanner sc = new Scanner(System.in);
+
+		// while 
+		int number = (int) (Math.random()*101);
+		System.out.println("输入数字");
+		// 猜数字
+		int guess = sc.nextInt();
+
+		while ( true ){
+			//判断提示
+			if ( guess > number ){
+				System.out.println("大了");
+			}
+
+			if ( guess < number){
+				System.out.println("小了");
+			}
+			if ( guess == number ){
+				System.out.println("猜对了"+number);
+				break;
+			}
+			//在输入
+			System.out.println("输入数字");
+			guess = sc.nextInt();
+		}
+
+		
+
+	}
+}

+ 91 - 0
01-JavaSe/day04/TestWhile03Ex.java.bak

@@ -0,0 +1,91 @@
+import java.util.*;
+
+class  TestWhile03Ex
+{
+	public static void main(String[] args) 
+	{
+		/*
+		随机生成一个100以内的数,猜这个随机数是多少?
+
+		从键盘输入数,如果大了,提示大了;如果小了,提示小了;如果对了,
+		就不再猜了,并统计一共猜了多少次。
+
+		提示:生成一个[a,b] 范围的随机数的方式:(int)(Math.random() * (b - a + 1) + a)
+		
+		Scanner sc = new Scanner(System.in);
+
+		// while 
+		int number = (int) (Math.random()*101);
+		System.out.println("输入数字");
+		// 猜数字
+		int guess = sc.nextInt();
+
+		while ( number != guess  ){
+			//判断提示
+			if ( guess > number ){
+				System.out.println("大了");
+			}else{
+				System.out.println("小了");
+			}
+			//在输入
+			System.out.println("输入数字");
+			guess = sc.nextInt();
+		}
+
+		System.out.println("猜对了"+number);
+
+		
+
+		Scanner sc = new Scanner(System.in);
+
+		// while 
+		int number = (int) (Math.random()*101);
+		System.out.println("输入数字");
+		// 猜数字
+		int guess = sc.nextInt();
+		do{
+			//判断提示
+			if ( guess > number ){
+				System.out.println("大了");
+			}else{
+				System.out.println("小了");
+			}
+			//在输入
+			System.out.println("输入数字");
+			guess = sc.nextInt();
+		}while(number != guess);
+
+		System.out.println("猜对了"+number);
+
+		*/
+
+				Scanner sc = new Scanner(System.in);
+
+		// while 
+		int number = (int) (Math.random()*101);
+		System.out.println("输入数字");
+		// 猜数字
+		int guess = sc.nextInt();
+
+		while ( true  ){
+			//判断提示
+			if ( guess > number ){
+				System.out.println("大了");
+			}
+
+			if ( guess < number){
+				System.out.println("小了");
+			}
+			if ( guess == number ){
+				System.out.println("猜对了"+number);
+				break;
+			}
+			//在输入
+			System.out.println("输入数字");
+			guess = sc.nextInt();
+		}
+
+		
+
+	}
+}

+ 21 - 0
01-JavaSe/day05/day05.iml

@@ -0,0 +1,21 @@
+<?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="jdk" jdkName="17" jdkType="JavaSDK" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module-library">
+      <library name="JUnit4">
+        <CLASSES>
+          <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.13.1/junit-4.13.1.jar!/" />
+          <root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+  </component>
+</module>

+ 40 - 0
01-JavaSe/day05/src/com/lovecoding/day05/Test04.java

@@ -0,0 +1,40 @@
+package com.lovecoding.day05;
+
+import org.junit.Test;
+
+import java.util.Arrays;
+
+/**
+ * ClassName: Test04
+ * Package: com.lovecoding.day05
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/5/19 11:17
+ * @Version 1.0
+ */
+public class Test04 {
+
+    @Test
+    public void test01(){
+        int[][] arr = new int[10][];
+
+
+        for (int i = 0; i < arr.length ; i++) {
+            arr[i] = new int[i+1];
+
+            for (int i1 = 0; i1 < arr[i].length; i1++) {
+                if (i1 == 0 || i1 == arr[i].length-1 ){
+                    arr[i][i1] = 1;
+                }else {
+                    arr[i][i1] = arr[i - 1][i1] + arr[i - 1][i1 - 1];
+                }
+            }
+        }
+
+        for (int[] ints : arr) {
+            System.out.println(Arrays.toString(ints));
+        }
+
+    }
+}

+ 63 - 0
01-JavaSe/day05/src/com/lovecoding/day05/TestBreakContniue03.java

@@ -0,0 +1,63 @@
+package com.lovecoding.day05;
+
+/**
+ * ClassName: TestLoop01
+ * Package: com.lovecoding.day05
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/5/7 10:58
+ * @Version 1.0
+ */
+public class TestBreakContniue03 {
+    //标签
+    public static void main(String[] args) {
+        a:for (int i = 0; i < 10; i++) {
+            b:for (int j = 0; j < 10; j++) {
+                if (j == 2){
+                    break a;
+                }
+                System.out.println(j);
+            }
+        }
+    }
+
+
+
+    //continue
+    public static void main3(String[] args) {
+        for (int i = 0; i < 5; i++) { //2 4
+            if ( i ==3 ){ // 1
+                continue;
+            }
+            System.out.println(i); // 1 5
+        }
+    }
+
+   //演示break
+   public static void main2(String[] args) {
+
+       for (int i = 0; i < 5; i++) {
+           for (int j = 0; j < 5 ; j++) {
+               if (j == 3){
+                   break;//结束当前循环
+               }
+               System.out.print(j);
+           }
+           System.out.println();
+       }
+
+   }
+
+   public static void main1(String[] args) {
+
+       for (int i = 0; i < 5; i++) {
+           if (i == 3){
+               break;
+           }
+           System.out.println(i);
+       }
+
+   }
+
+}

+ 113 - 0
01-JavaSe/day05/src/com/lovecoding/day05/TestForForLoop02.java

@@ -0,0 +1,113 @@
+package com.lovecoding.day05;
+
+/**
+ * ClassName: TestForForLoop02
+ * Package: com.lovecoding.day05
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/5/7 11:38
+ * @Version 1.0
+ */
+public class TestForForLoop02 {
+    //**案例4:打印"菱形"形状的图案**
+    /*                      10 - i*2;   i*2 - 1
+     --------*              8           1
+     ------* * *            6           3
+         * * * * *          4           5
+       * * * * * * *        2           7
+     * * * * * * * * *      0           9
+
+
+     */
+
+    public static void main(String[] args) {
+        //外  行数
+        for (int i = 1; i <= 5; i++) { // 外层 特点 1-5  外层循环控制内层循环
+            //内  列
+            for (int j = 1; j <= 10 - i*2 ; j++) { // 10 8 6 4 2 0
+                System.out.print(" ");
+            }
+            for (int j = 1; j <= i*2 - 1 ; j++) { // 1 3 5 7 9
+                System.out.print(" *");
+            }
+
+            System.out.println();
+        }
+    }
+    public static void main5(String[] args) {
+        //外  行数
+        for (int i = 1; i <= 5; i++) { // 外层 特点 1-5  外层循环控制内层循环
+            //内  列
+            for (int j = 1; j <= 6-i ; j++) { // 5 4 3 2 1
+                System.out.print("  ");
+            }
+            for (int j = 1; j <= i ; j++) { // 1 2 3 4 5
+                System.out.print(" *");
+            }
+            for (int j = 1; j <= i-1 ; j++) { // 1 2 3 4 5
+                System.out.print(" *");
+            }
+            System.out.println();
+        }
+    }
+
+
+
+    //**案例3:**打印5行倒直角三角形
+    public static void main4(String[] args) {
+        //外  行数
+        for (int i = 1; i <= 5; i++) { // 外层 特点 1-5  外层循环控制内层循环
+            //内  列
+            for (int j = 1; j <= 6-i ; j++) { // 5 4 3 2 1
+                System.out.print(" *");
+            }
+            System.out.println();
+        }
+    }
+
+    //**案例2:**打印5行直角三角形
+    public static void main3(String[] args) {
+
+        //外  行数
+        for (int i = 1; i <= 5; i++) { // 外层 特点 1-5  外层循环控制内层循环
+            //内  列
+            for (int j = 1; j <= i ; j++) {
+                System.out.print(" *");
+            }
+            System.out.println();
+        }
+
+    }
+    //打印5行6个*
+    public static void main2(String[] args) {
+        //外  行数
+        for (int i = 1; i <= 5; i++) {
+            //内  列
+            for (int j = 1; j <= 6 ; j++) {
+                System.out.print(" *");
+            }
+
+            System.out.println();
+        }
+    }
+
+    public static void main1(String[] args) {
+
+        for (int i = 0; i < 5 ; i++) {
+            //外  int i = 0 初始化   i < 5  判断  循环体  内层循环 是 整体循环体
+            //内  int j = 0 初始化   j < 5  判断  循环体  System.out.print(" *");
+            for (int j = 0; j < 5; j++) {
+                System.out.print(" *");
+            }
+            System.out.println();
+        }
+
+        //执行顺序
+
+        // 特点 :外层循环执行一次,内层循环执行一轮。
+
+
+    }
+
+}

+ 34 - 0
01-JavaSe/day05/src/com/lovecoding/day05/TestLoop01.java

@@ -0,0 +1,34 @@
+package com.lovecoding.day05;
+
+/**
+ * ClassName: TestLoop01
+ * Package: com.lovecoding.day05
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/5/7 10:58
+ * @Version 1.0
+ */
+public class TestLoop01 {
+
+    // psvm 生成主函数
+    /*
+        死循环
+        for( ;; ){}
+
+        while(true){}
+     */
+    public static void main(String[] args) {
+        while(true) {
+            System.out.println("永远Ikun");
+        }
+        //System.out.println("不爱ikun 爱凡凡"); //没有意义 上面是无限循环 永远不能执行
+    }
+
+    public static void main1(String[] args) {
+        for (; ; ) {
+            System.out.println("永远Ikun");
+        }
+    }
+
+}

+ 50 - 0
01-JavaSe/day05/src/com/lovecoding/day05/ex/TestForEx01.java

@@ -0,0 +1,50 @@
+package com.lovecoding.day05.ex;
+
+//自动导入
+import java.util.Scanner;
+
+/**
+ * ClassName: TestForEx01
+ * Package: com.lovecoding.day05.ex
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/5/7 11:04
+ * @Version 1.0
+ */
+public class TestForEx01 {
+    //从键盘读入个数不确定的整数,并判断读入的正数和负数的个数,输入为0时结束程序。
+
+    //while
+    //输入 Scanner
+    //条件 != 0
+    public static void main(String[] args) {
+        Scanner scanner = new Scanner(System.in);//万能键 Alt Enter
+
+        System.out.println("输入整数,0为停止"); //sout 输出
+        //计数
+        int z = 0;
+        int f = 0;
+
+        int number = scanner.nextInt();
+
+        while (number != 0){
+            //判断
+            if (number > 0 ){
+                z++;
+            }
+
+            if (number < 0 ){
+                f++;
+            }
+            //从新赋值
+            number = scanner.nextInt();
+        }
+
+        System.out.println("正整数个数:"+z);
+        System.out.println("负整数个数:"+f);
+
+    }
+
+
+}

+ 73 - 0
01-JavaSe/day05/src/com/lovecoding/day05/ex/TestForEx02.java

@@ -0,0 +1,73 @@
+package com.lovecoding.day05.ex;
+
+//自动导入
+import java.util.Scanner;
+
+/**
+ * ClassName: TestForEx01
+ * Package: com.lovecoding.day05.ex
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/5/7 11:04
+ * @Version 1.0
+ */
+public class TestForEx02 {
+    //找出100以内所有的素数(质数)?100000以内的呢?**
+    //目的:不同的代码的实现方式,可以效率差别很大。
+    //分析:素数(质数):只能被1和它本身整除的自然数。 7  11 13
+    // ---> 从2开始,到这个数-1为止,此范围内没有这个数的约数。则此数是一个质数。
+    //比如:2、3、5、7、11、13、17、19、23、...
+
+    //27 mo 2 - 26  标志
+    //27 mo 2 - 26  标志  flag true
+    public static void main(String[] args) {
+        long l1 = System.currentTimeMillis();
+        boolean flag  = true;
+        for (int i = 2; i < 10000000 ; i++) {
+
+            //7  2 - 6
+            // 2 - i - 1
+            for (int j = 2; j < i; j++) {
+                if (i % j == 0){
+                    //改变flag
+                    flag = false;
+                }
+            }
+            //判断标识
+            if (flag){
+                //System.out.println(i);
+            }
+            flag = true;
+        }
+
+        long l2 = System.currentTimeMillis();
+        System.out.println(l2-l1);
+    }
+
+    //优化
+    public static void main1(String[] args) {
+        long l1 = System.currentTimeMillis();
+        boolean flag  = true;
+        for (int i = 2; i < 10000000 ; i++) {
+
+            //开方
+            for (int j = 2; j < Math.sqrt(i); j++) {
+                if (i % j == 0){
+                    //改变flag
+                    flag = false;
+                    //有一个可以mo开的数字就不向下执行了
+                    break;
+                }
+            }
+            //判断标识
+            if (flag){
+                //System.out.println(i);
+            }
+            flag = true;
+        }
+        long l2 = System.currentTimeMillis();
+
+        System.out.println(l2-l1);
+    }
+}

+ 21 - 0
01-JavaSe/day06/day06.iml

@@ -0,0 +1,21 @@
+<?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" />
+    <orderEntry type="module-library">
+      <library name="JUnit4">
+        <CLASSES>
+          <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.13.1/junit-4.13.1.jar!/" />
+          <root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+  </component>
+</module>

+ 73 - 0
01-JavaSe/day06/src/com/lovecoding/day06/TestArr01.java

@@ -0,0 +1,73 @@
+package com.lovecoding.day06;
+
+public class TestArr01 {
+
+    public static void main(String[] args) {
+        //数组
+        //String 数组 存储 5个同学名称
+        //两种方式
+
+        //静态
+        //
+        String[] names = new String[]{"华晨宇","小鬼","坤坤","王嘉尔","凡凡","华晨宇","小鬼","坤坤","王嘉尔","凡凡","华晨宇","小鬼","坤坤","王嘉尔","凡凡"};
+        //Ctrl + d
+
+        //操作 索引 0 开始
+        names[2] = "峰峰";
+
+        String ff = names[2];
+        System.out.println(ff);
+
+        //获取长度 length 长度
+        System.out.println(names.length);
+
+        //Ctrl + Shirt + ^ 上下移动
+        //Ctrl + W 选中当前单词
+        int[] ages = {10,20,30,40};
+
+        //动态初始化
+        String[] schools = new String[3];
+
+        //赋值 索引
+        schools[0] = "黑大";
+        schools[1] = "理工";
+        schools[2] = "黑工程";
+
+        //长度
+        System.out.println(schools.length);
+
+        //1元素  索引为0的位置
+        System.out.println(schools[0]);
+
+
+        //寝室成员的 (姓名,年龄,家庭地址,身高) 选用想应的集合 定义
+
+
+
+        String[] address = new String[3];
+
+        //赋值 索引
+        address[0] = "北京";
+        address[1] = "上海";
+        address[2] = "深圳";
+
+        //遍历 for
+        System.out.println("------------");
+        for (int i = 0 ; i < address.length ; i++ ){
+            //索引获取
+            System.out.println(address[i]);
+        }
+        System.out.println("------------");
+        //快捷键
+        for (int i = 0; i < address.length; i++) {
+            //索引获取
+            System.out.println(address[i]);
+        }
+        System.out.println("------------");
+        // 增强for
+        // address 数组 String 元素类型   s 元素的变量
+        for (String s : address) {
+            System.out.println(s);
+        }
+    }
+}

+ 22 - 0
01-JavaSe/day06/src/com/lovecoding/day06/TestArr02.java

@@ -0,0 +1,22 @@
+package com.lovecoding.day06;
+
+public class TestArr02 {
+
+    public static void main(String[] args) {
+        //默认值
+        int[] arr1 = new int[3];
+        System.out.println(arr1[0]);// 默认值  0
+
+        String[] arr2 = new String[3];
+        System.out.println(arr2[0]);// 默认值 null 引用数据类型
+
+        double[] arr3 = new double[3];
+        System.out.println(arr3[0]);// 默认值  0.0
+
+        boolean[] arr4 = new boolean[3];
+        System.out.println(arr4[0]);// 默认值 false
+
+        char[] arr5 = new char[3];
+        System.out.println(arr5[0]);// 默认值 空
+    }
+}

+ 30 - 0
01-JavaSe/day06/src/com/lovecoding/day06/TestArr03.java

@@ -0,0 +1,30 @@
+package com.lovecoding.day06;
+
+public class TestArr03 {
+
+    public static void main(String[] args) {
+        //静态的
+//        int[] arr1 = new int[]{1,2,3};
+//
+//        //值 = [I@4eec7777
+//        System.out.println(arr1);
+//
+//        arr1[1] = 22;
+//
+//        System.out.println(arr1[1]);
+
+        //动态的
+        int[] arr2 = new int[3];
+
+        arr2[0] = 1;
+        arr2[1] = 2;
+        arr2[2] = 3;
+
+        System.out.println(arr2[2]); //3
+        arr2[2] = 33;
+        System.out.println(arr2[2]); //33
+
+
+        System.out.println("------------");
+    }
+}

+ 27 - 0
01-JavaSe/day06/src/com/lovecoding/day06/TestArr03m2.java

@@ -0,0 +1,27 @@
+package com.lovecoding.day06;
+
+public class TestArr03m2 {
+
+    public static void main(String[] args) {
+
+
+        //动态的
+        int[] arr1 = new int[3];
+        arr1[0] = 1;
+        arr1[1] = 2;
+        arr1[2] = 3;
+        System.out.println(arr1);
+
+        int[] arr2 = arr1;
+
+        System.out.println(arr2);
+
+        arr2[1] = 234;
+
+        System.out.println(arr1[1]);// ?? 234
+
+
+
+
+    }
+}

+ 28 - 0
01-JavaSe/day06/src/com/lovecoding/day06/TestArr03m3.java

@@ -0,0 +1,28 @@
+package com.lovecoding.day06;
+
+public class TestArr03m3 {
+
+    public static void main(String[] args) {
+
+
+        //动态的
+        int[] arr1 = new int[3];
+        arr1[0] = 1;
+        arr1[1] = 2;
+        arr1[2] = 3;
+
+        int[] arr2 = new int[4];
+
+        int[] arr3 = arr2;
+
+        arr3[1] = 234;
+
+        arr1 = arr3;
+
+        System.out.println(arr1[1]); // ??  234
+
+
+        
+
+    }
+}

+ 41 - 0
01-JavaSe/day06/src/com/lovecoding/day06/TestArrArr04.java

@@ -0,0 +1,41 @@
+package com.lovecoding.day06;
+
+import org.junit.Test;
+
+public class TestArrArr04 {
+
+    @Test
+    public void  test01(){
+        //二维数组的初始化
+        //静态
+        int[][] arr = new int[][]{
+                {11,12,13}, //第一个元素 = 数组
+                {12,13,16}, //第二个元素 = 数组
+                {14,18,26}, //第三个元素 = 数组
+                {22,23,16}
+        };
+
+        int[][] arr1 ={
+            {11,12,13}, //第一个元素 = 数组
+            {12,13,16}, //第二个元素 = 数组
+            {14,18,26}, //第三个元素 = 数组
+            {22,23,16}
+        };
+
+
+        //动态初始化
+        int[][] arr3 = new int[10][];
+
+        //可以任意赋值
+        arr3[0] = new int[]{10,20};
+        arr3[1] = new int[3];
+
+        //大数组长度 必须有
+
+        int[][] arr4 = new int[10][10];
+
+
+
+    }
+
+}

+ 34 - 0
01-JavaSe/day06/src/com/lovecoding/day06/TestArrArr05.java

@@ -0,0 +1,34 @@
+package com.lovecoding.day06;
+
+import org.junit.Test;
+
+public class TestArrArr05 {
+
+    @Test
+    public void  test01(){
+        //二维数组初始化
+
+        int[][] arr1 ={
+            {11,12,13},
+            {12,13,16}, //索引 大数组1   小数组 索引1
+            {14,18,26},
+            {22,23,16}
+        };
+
+        // 索引
+        // 第二季度 第二个月的 销售额
+        System.out.println("销售额"+arr1[1][1]);
+
+        //第三季度 最后一个月
+        //获取小数组的长度 - 1 就是最后一个
+        System.out.println("销售额"+arr1[2][arr1[2].length-1]);
+
+        //大长度
+        System.out.println(arr1.length);
+        //小数组 索引
+        System.out.println(arr1[0].length);
+
+
+    }
+
+}

+ 50 - 0
01-JavaSe/day06/src/com/lovecoding/day06/TestArrArr06.java

@@ -0,0 +1,50 @@
+package com.lovecoding.day06;
+
+import org.junit.Test;
+
+public class TestArrArr06 {
+
+    @Test
+    public void  test01(){
+        //二维数组初始化
+
+        int[][] arr1 ={
+            {11,12,13,123,123,123,12},
+            {12,13,16,123,12},
+            {14,18,26,234,34},
+            {22,23,16}
+        };
+
+        // 遍历  forfor
+        for (int i = 0; i < arr1.length; i++) {
+            //System.out.println(arr1[i]);//地址值 小数组的地址
+
+            for (int j = 0; j < arr1[i].length; j++) {
+                System.out.print("元素:"+arr1[i][j]);
+            }
+            System.out.println();
+        }
+
+
+
+        // 求和
+        int sum = 0;
+        for (int i = 0; i < arr1.length; i++) {
+            //System.out.println(arr1[i]);//地址值 小数组的地址
+
+            for (int j = 0; j < arr1[i].length; j++) {
+                sum+=arr1[i][j];
+            }
+        }
+
+        System.out.println("和:"+sum);
+
+        //声明
+        int[] x,y[];
+
+        //x 一维数组   y 二维数组
+        int[] x1;
+        int[] y1[];
+    }
+
+}

+ 31 - 0
01-JavaSe/day06/src/com/lovecoding/day06/TestArrArr07.java

@@ -0,0 +1,31 @@
+package com.lovecoding.day06;
+
+import org.junit.Test;
+
+public class TestArrArr07 {
+
+    @Test
+    public void  test01(){
+        //二维数组初始化
+
+        int[][] arr1 = new int[3][] ;
+
+
+        System.out.println(arr1[0]);
+
+        arr1[0] = new int[2];
+
+        System.out.println(arr1[0]);
+
+        arr1[1] = new int[4];
+        arr1[2] = new int[3];
+
+
+        arr1[0][1] = 10;
+        arr1[1][3] = 11;
+        arr1[2][0] = 12;
+
+
+    }
+
+}

+ 124 - 0
01-JavaSe/day06/src/com/lovecoding/day06/TestArrEx01.java

@@ -0,0 +1,124 @@
+package com.lovecoding.day06;
+
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.Scanner;
+
+public class TestArrEx01 {
+
+    //psvm 主函数 只有一个
+
+    //程序员用数组存储电话号码:第一个数组是电话号码出现的数字,第二个数组是数字出现的位置。
+    @Test //Alt 回车 junit4
+    public void test01(){
+        int[] arr = new int[]{8,2,1,0,3};
+        int[] index = new int[]{2,0,3,2,4,0,1,3,2,3,3};
+
+        String number = "";
+
+        for (int i = 0; i < index.length; i++) {
+            //index[i]值当作另一个数组的下标
+            number+= arr[index[i]];
+        }
+
+        //电话号码
+        System.out.println("电话号码:"+number);
+    }
+
+    /*
+    用一个数组,保存星期一到星期天的7个英语单词,从键盘输入1-7,显示对应的单词
+{"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"}
+     */
+    //定义方法
+    public static void test02(){
+        String[] weeks = {"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"};
+
+        //键盘输入
+        Scanner sc = new Scanner(System.in);
+
+        System.out.println("从键盘输入1-7");
+        int num = sc.nextInt();
+
+        if (num >= 1  && num <= 7){
+            System.out.println("输入的是:"+num +"对应的星期是:"+weeks[num-1]);
+        }else {
+            System.out.println("输入不符合要求");
+        }
+    }
+
+
+
+    /*
+    从键盘读入学生成绩,找出最高分,并输出学生成绩等级。
+    - 成绩>=最高分-10  等级为’A’
+    - 成绩>=最高分-20  等级为’B’
+    - 成绩>=最高分-30  等级为’C’
+    - 其余            等级为’D’
+    提示:先读入学生人数,根据人数创建int数组,存放学生成绩。
+
+    输入数组长度
+    创建数组
+    输入成绩
+    找出 for 最大值
+
+    最大值 - 10 A
+
+     */
+    //定义方法
+    public static void test03(){
+        Scanner sc = new Scanner(System.in);
+        System.out.println("请输入学生人数");
+        int len = sc.nextInt();
+
+        if ( len < 0 ){
+            System.out.println("输入有误");
+        }
+
+        //创建数组
+        int[] ss = new int[len];
+
+        for (int i = 0; i < ss.length; i++) {
+            System.out.println("请输入第"+(i+1)+"个学生的成绩");
+            ss[i] = sc.nextInt();
+        }
+
+        //成绩
+        System.out.println(Arrays.toString(ss));
+
+        //最大值 假设第一个值是最大值
+        int max = ss[0];
+        for (int i = 0; i < ss.length; i++) {
+            if (ss[i]>max){
+                max = ss[i];
+            }
+        }
+
+        System.out.println("最高成绩是:"+max);
+
+        for (int i = 0; i < ss.length; i++) {
+            int s = ss[i];
+            if (s >= max - 10 ){
+                System.out.println("第"+(i+1)+"成绩等级为A");
+            }else if(s >= max - 20 ){
+                System.out.println("第"+(i+1)+"成绩等级为B");
+            }else if(s >= max - 30 ){
+                System.out.println("第"+(i+1)+"成绩等级为C");
+            }else {
+                System.out.println("第"+(i+1)+"成绩等级为D");
+            }
+        }
+    }
+
+
+    public static void main(String[] args) {
+        //调用
+        //test02();
+        test03();
+    }
+
+
+
+
+
+}

+ 50 - 0
01-JavaSe/day06/src/com/lovecoding/day06/TestArrEx02.java

@@ -0,0 +1,50 @@
+package com.lovecoding.day06;
+
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.Scanner;
+
+public class TestArrEx02 {
+
+    /**
+     * TestArrEx01
+     * 使用二维数组打印一个 10 行杨辉三角。
+     * 1
+     * 1 1
+     * 1 2 1
+     * 1 3 3 1
+     * 1 4 6 4 1
+     *
+     * 提示:
+     * 1. 第一行有 1 个元素, 第 n 行有 n 个元素
+     * 2. 每一行的第一个元素和最后一个元素都是 1
+     * 3. 从第三行开始, 对于非第一个元素和最后一个元素的元素。即:
+     *    yanghui[i][j] = yanghui[i-1][j-1] + yanghui[i-1][j];
+     */
+    public static void main(String[] args) {
+        int[][] arr = new int[10][];
+
+
+        for (int i = 0; i < 10; i++) {
+            // 小数组创建数 赋值
+            arr[i] = new int[i+1];
+            //赋值
+            for (int j = 0; j < arr[i].length; j++) {
+                if (j == 0  ||  j == i ){
+                    arr[i][j] = 1;
+                }else{
+                    arr[i][j] =  arr[i-1][j-1] + arr[i-1][j];
+                }
+            }
+        }
+
+        //遍历
+        for (int i = 0; i < arr.length; i++) {
+            for (int j = 0; j <arr[i].length ; j++) {
+                System.out.print(" "+arr[i][j]);
+            }
+            System.out.println();
+        }
+    }
+}

二進制
01-JavaSe/out/production/day05/com/lovecoding/day05/Test04.class


二進制
01-JavaSe/out/production/day05/com/lovecoding/day05/TestBreakContniue03.class


二進制
01-JavaSe/out/production/day05/com/lovecoding/day05/TestForForLoop02.class


二進制
01-JavaSe/out/production/day05/com/lovecoding/day05/TestLoop01.class


二進制
01-JavaSe/out/production/day05/com/lovecoding/day05/ex/TestForEx01.class


二進制
01-JavaSe/out/production/day05/com/lovecoding/day05/ex/TestForEx02.class