diff --git "a/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text01.java" "b/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text01.java" new file mode 100644 index 0000000000000000000000000000000000000000..5419555cbc8a74168bd5a63512858be45cff6074 --- /dev/null +++ "b/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text01.java" @@ -0,0 +1,10 @@ +package com.md.code; + +public class Text01 { + public static void main(String[] args) { + for (int i = 1; i <= 10; i++) { + if(i % 2 != 0) continue; + System.out.println("i ----> " + i); + } + } +} diff --git "a/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text02.java" "b/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text02.java" new file mode 100644 index 0000000000000000000000000000000000000000..26f965fd3f8bd0ccb1416be6e8864b50355d4640 --- /dev/null +++ "b/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text02.java" @@ -0,0 +1,27 @@ +package com.md.code; + +public class Text02 { + public static void main(String[] args) { + for(int i = 1; i <= 10; i++) { + for(int j = 1; j <= 10 - i; j++) { + System.out.print(" "); + } + for(int k = 1; k <= i * 2 - 1; k++) { + + System.out.print("·"); + } + System.out.println(); + } + for(int i = 10; i >= 1; i--) { + for(int j = 1; j <= 11 - i; j++) { + System.out.print(" "); + } + for(int k = 1; k < i * 2 - 2; k++) { + System.out.print("·"); + } + System.out.println(); + } + + } + +} diff --git "a/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text03.java" "b/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text03.java" new file mode 100644 index 0000000000000000000000000000000000000000..d0e40dc202ead35922c4b37ed266a5005625ac20 --- /dev/null +++ "b/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text03.java" @@ -0,0 +1,33 @@ +package com.md.code; + +import java.util.Scanner; + +public class Text03 { + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + float score = 1; + int count = 0; + float sum = 0; + while(score != 0) { + System.out.println("请输入你的成绩:"); + score = (float) scanner.nextDouble(); + if(score > 100 || score < 0) { + System.out.println("输入错误,请重新输入:"); + System.out.println("请输入你的成绩:"); + score = scanner.nextInt(); + count++; + sum += score; + } + if(score != 0) count++; + sum += score; + } + float arvg = sum / count; + + if(!Double.isNaN(arvg)) { + System.out.println("arvg = " + arvg); + System.out.println("您的总成绩为:" + sum); + }else { + System.out.println("检测到您未输入成绩或成绩为0,请重新进入系统计算。"); + } + } +} diff --git "a/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text04.java" "b/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text04.java" new file mode 100644 index 0000000000000000000000000000000000000000..b4ddcc81285c84e0ec7cda46bfd822d4c18dfe47 --- /dev/null +++ "b/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text04.java" @@ -0,0 +1,19 @@ +package com.md.code; + +public class Text04 { +public static void main(String[] args) { + + int j = 1; + int day = 10; + System.out.print("第 10 天"); + System.out.println(" " + j + " 桃"); + + for(int i = 0; i < 9; i++) { + --day; + j = (j + 1) * 2 ; + System.out.print("第 " + day + " 天"); + System.out.println(" " + j + " 桃"); + } + + } +} diff --git "a/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text05.java" "b/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text05.java" new file mode 100644 index 0000000000000000000000000000000000000000..f3b5b074bf256da8804c4ea3e95bb2b30072d1aa --- /dev/null +++ "b/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text05.java" @@ -0,0 +1,21 @@ +package com.md.code; + +import java.util.Scanner; + +public class Text05 { + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + System.out.println("请输入正方形行数:"); + int z = scanner.nextInt(); + for (int i = 0; i < z; i++) { + for (int j = 0; j < z; j++) { + if (i == 0 || i == z - 1 || j == 0 || j == z - 1) { + System.out.print(" *"); + }else { + System.out.print(" "); + } + } + System.out.println(); + } + } +} diff --git "a/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text06.java" "b/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text06.java" new file mode 100644 index 0000000000000000000000000000000000000000..8b544bc5b46148ab6fe4dca8bd3ee25a445b5945 --- /dev/null +++ "b/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text06.java" @@ -0,0 +1,16 @@ +package com.md.code; + +public class Text06 { + public static void main(String[] args) { + for(int i = 100; i < 1000; i++) { + int bai = i / 100; + int shi = i / 10 % 10; + int ge = i % 10; + int shui = bai * bai * bai + shi * shi * shi + ge * ge * ge; + if(shui == i) { + System.out.println(i); + } + } + + } +} diff --git "a/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text07.java" "b/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text07.java" new file mode 100644 index 0000000000000000000000000000000000000000..f1f66ccb2a7043a4729c14b7614bdfc1968b09be --- /dev/null +++ "b/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text07.java" @@ -0,0 +1,12 @@ +package com.md.code; + +public class Text07 { + public static void main(String[] args) { + for(int i = 1; i <= 9; i++) { + for(int j = 1; j <= i; j++) { + System.out.print(j + "*" + i + "=" + (i * j) + "\t"); + } + System.out.println(); + } + } +} diff --git "a/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text08.java" "b/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text08.java" new file mode 100644 index 0000000000000000000000000000000000000000..510f3a4b3188d2bdae35e67e32a4a375cce0f7f0 --- /dev/null +++ "b/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text08.java" @@ -0,0 +1,16 @@ +package com.md.code; + +import java.util.Scanner; + +public class Text08 { + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + int i; + int arr[] = new int [] {19,28,37,46,50}; + + System.out.println("输入一个数据:"); + i = scanner.nextInt(); + + System.out.println(arr[i]); + } +} diff --git "a/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text09.java" "b/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text09.java" new file mode 100644 index 0000000000000000000000000000000000000000..cca61a7ee2f71297b9c06a9a00ad185ddcb578ef --- /dev/null +++ "b/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text09.java" @@ -0,0 +1,18 @@ +package com.md.code; + +import java.util.Scanner; + +public class Text09 { + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + System.out.println("请输入边长:"); + int a = scanner.nextInt(); + for (int i = 0; i < a; i++) { + + for (int j = 0; j < a; j++) { + System.out.print(" *"); + } + System.out.println(""); + } + } +} diff --git "a/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text10.java" "b/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text10.java" new file mode 100644 index 0000000000000000000000000000000000000000..af3c0a9b59c3baa9b91a780c02c06892028ca398 --- /dev/null +++ "b/Java\347\254\254\344\270\203\346\254\241\344\275\234\344\270\232/\350\260\255\350\277\233/com/md/code/Text10.java" @@ -0,0 +1,29 @@ +package com.md.code; + +import java.util.Scanner; + +public class Text10 { + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + int a[]=new int[5]; + int sum = 0; + int max=0; + int min = 100; + for (int i = 0; i < a.length; i++) { + System.out.println("请输入年龄 "+ (i + 1) + ":" ); + a[i]=scanner.nextInt(); + sum += a[i]; + if (max < a[i]) { + max = a[i]; + } + if (min > a[i]) { + min = a[i]; + } + } + System.out.println("平均数:" + (sum / 5)); + System.out.println("最大值:" + max); + System.out.println("最小值:" + min); + } +} + +