commit c952de844644e8d47f29dc328281c296b3333cd4 Author: LHY0125 <3364451258@qq.com> Date: Mon Dec 15 20:39:50 2025 +0800 更新 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0696a71 --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +# 排除可执行文件 +*.out +*.o + +# 排除IDE配置文件 +.idea/ +.vs/ +.vscode/ + +# 排除Trae AI配置文件 +.trae/ + +# 排除编译输出目录 +output/ + +# 排除临时文件 +*.tmp +*.temp + +# 排除系统文件 +.DS_Store +Thumbs.db + +# 排除竞赛平台配置文件 +.cph/ \ No newline at end of file diff --git a/bin/Main.class b/bin/Main.class new file mode 100644 index 0000000..f69b942 Binary files /dev/null and b/bin/Main.class differ diff --git a/exercise/bin/InsertSorted.class b/exercise/bin/InsertSorted.class new file mode 100644 index 0000000..b3ed44a Binary files /dev/null and b/exercise/bin/InsertSorted.class differ diff --git a/exercise/bin/Main.class b/exercise/bin/Main.class new file mode 100644 index 0000000..89e5249 Binary files /dev/null and b/exercise/bin/Main.class differ diff --git a/exercise/src/Main.class b/exercise/src/Main.class new file mode 100644 index 0000000..f3f2a11 Binary files /dev/null and b/exercise/src/Main.class differ diff --git a/exercise/src/Main.java b/exercise/src/Main.java new file mode 100644 index 0000000..8246aa4 --- /dev/null +++ b/exercise/src/Main.java @@ -0,0 +1,59 @@ +import java.util.Scanner; + +public class Main { + static boolean isPrime(int x) { + if (x < 2) + return false; + if (x % 2 == 0) + return x == 2; + for (int i = 3; i * i <= x; i += 2) { + if (x % i == 0) + return false; + } + return true; + } + + static boolean noZero(String s) { + for (int i = 0; i < s.length(); i++) + if (s.charAt(i) == '0') + return false; + return true; + } + + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + String s = in.next().trim(); + boolean left = false, right = false; + if (noZero(s)) { + boolean ok = true; + for (int i = 0; i < s.length(); i++) { + int v = Integer.parseInt(s.substring(i)); + if (!isPrime(v)) { + ok = false; + break; + } + } + left = ok; + } + if (noZero(s)) { + boolean ok = true; + for (int i = s.length(); i >= 1; i--) { + int v = Integer.parseInt(s.substring(0, i)); + if (!isPrime(v)) { + ok = false; + break; + } + } + right = ok; + } + if (left && right) + System.out.println("both"); + else if (left) + System.out.println("left"); + else if (right) + System.out.println("right"); + else + System.out.println("false"); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day1/第一题/DivideNum.java b/作业/作业/刘航宇-day1/第一题/DivideNum.java new file mode 100644 index 0000000..8101efe --- /dev/null +++ b/作业/作业/刘航宇-day1/第一题/DivideNum.java @@ -0,0 +1,18 @@ +import java.util.Scanner; + +public class DivideNum { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int num = 0; + System.out.println("请输入一个非负三位整数:"); + num = in.nextInt(); + int hundreds = num / 100; + int tens = (num / 10) % 10; + int units = num % 10; + System.out.println(hundreds); + System.out.println(tens); + System.out.println(units); + + in.close(); + } +} diff --git a/作业/作业/刘航宇-day1/第一题/屏幕截图 2025-10-27 210600.png b/作业/作业/刘航宇-day1/第一题/屏幕截图 2025-10-27 210600.png new file mode 100644 index 0000000..939c63f Binary files /dev/null and b/作业/作业/刘航宇-day1/第一题/屏幕截图 2025-10-27 210600.png differ diff --git a/作业/作业/刘航宇-day1/第二题/ca.java b/作业/作业/刘航宇-day1/第二题/ca.java new file mode 100644 index 0000000..d552da8 --- /dev/null +++ b/作业/作业/刘航宇-day1/第二题/ca.java @@ -0,0 +1,14 @@ +import java.util.Scanner; + +public class ca { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + double r = 0; + r= in.nextDouble(); + double S_fang = r * r; + double S_yuan = 3.14 * (r * r)/4; + double S_ca = S_fang - S_yuan; + System.out.println("面积差是:" + S_ca); + in.close(); + } +} diff --git a/作业/作业/刘航宇-day1/第二题/屏幕截图 2025-10-27 211246.png b/作业/作业/刘航宇-day1/第二题/屏幕截图 2025-10-27 211246.png new file mode 100644 index 0000000..dcbe437 Binary files /dev/null and b/作业/作业/刘航宇-day1/第二题/屏幕截图 2025-10-27 211246.png differ diff --git a/作业/作业/刘航宇-day11/第一题/image.png b/作业/作业/刘航宇-day11/第一题/image.png new file mode 100644 index 0000000..901fb45 Binary files /dev/null and b/作业/作业/刘航宇-day11/第一题/image.png differ diff --git a/作业/作业/刘航宇-day11/第一题/max.java b/作业/作业/刘航宇-day11/第一题/max.java new file mode 100644 index 0000000..39a095b --- /dev/null +++ b/作业/作业/刘航宇-day11/第一题/max.java @@ -0,0 +1,40 @@ +import java.util.Scanner; + +public class max { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + System.out.print("请输入三个整数,以空格分隔: "); + int a, b, c; + a = in.nextInt(); + b = in.nextInt(); + c = in.nextInt(); + + int max = a; + if (b > max) { + max = b; + } + if (c > max) { + max = c; + } + + int min = a; + if (b < min) { + min = b; + } + if (c < min) { + min = c; + } + + int result; + if (a != max && a != min) { + result = a; + } else if (b != max && b != min) { + result = b; + } else { + result = c; + } + + System.out.println("第二小值是: " + result); + in.close(); + } +} diff --git a/作业/作业/刘航宇-day11/第二题/Num.java b/作业/作业/刘航宇-day11/第二题/Num.java new file mode 100644 index 0000000..c0eca96 --- /dev/null +++ b/作业/作业/刘航宇-day11/第二题/Num.java @@ -0,0 +1,61 @@ +import java.util.Scanner; + +public class Num { + private static int min_m(int n, int m) { + int result = n - (m * (m - 1) / 2); + // 分子≤0 或 无法被m整除 → 不满足条件 + if (result <= 0 || result % m != 0) { + return -1; + } + // 返回连续序列的首项a(正整数) + return result / m; + } + + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + System.out.print("请输入n:"); + int n = in.nextInt(); + + // 防止输入错误 + if (n < 1 || n > 10000) { + System.out.println("无符合条件的连续正整数序列"); + System.out.println("n应该在1-10000之间"); + in.close(); + return; + } + + boolean found = false; + int m = 2; + int firstnum = -1; + + // 从m=2开始寻找,找到第一个满足条件的m就停止 + for (m = 2; m <= 150; m++) { + int sum_m = m * (m - 1) / 2; + // 如果n小于等于前m-1个数的和,说明m太大 + if (n <= sum_m) { + break; + } + + firstnum = min_m(n, m); + if (firstnum != -1) { + found = true; + break; + } + } + + if (found) { + System.out.print(n + "="); + for (int i = 0; i < m; i++) { + System.out.print(firstnum + i); + if (i < m - 1) { + System.out.print("+"); + } + } + } + else { + System.out.println("无符合条件的连续正整数序列"); + } + + in.close(); + } +} diff --git a/作业/作业/刘航宇-day11/第二题/image.png b/作业/作业/刘航宇-day11/第二题/image.png new file mode 100644 index 0000000..01fbbe8 Binary files /dev/null and b/作业/作业/刘航宇-day11/第二题/image.png differ diff --git a/作业/作业/刘航宇-day12/第一题/image.png b/作业/作业/刘航宇-day12/第一题/image.png new file mode 100644 index 0000000..f988f4d Binary files /dev/null and b/作业/作业/刘航宇-day12/第一题/image.png differ diff --git a/作业/作业/刘航宇-day12/第一题/shiyi.java b/作业/作业/刘航宇-day12/第一题/shiyi.java new file mode 100644 index 0000000..a3206bc --- /dev/null +++ b/作业/作业/刘航宇-day12/第一题/shiyi.java @@ -0,0 +1,23 @@ +import java.util.Scanner; + +public class shiyi { + private static int f(int n) { + if (n == 1) { + return 1; + } + if (n == 2) { + return 1; + } + return 2*f(n-2)+f(n-1); + } + + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + System.out.print("请输入一个整数n:"); + int n = in.nextInt(); + int result = f(n); + System.out.println(result); + + in.close(); + } +} diff --git a/作业/作业/刘航宇-day12/第二题/image.png b/作业/作业/刘航宇-day12/第二题/image.png new file mode 100644 index 0000000..febe6ee Binary files /dev/null and b/作业/作业/刘航宇-day12/第二题/image.png differ diff --git a/作业/作业/刘航宇-day12/第二题/perfect.java b/作业/作业/刘航宇-day12/第二题/perfect.java new file mode 100644 index 0000000..30181aa --- /dev/null +++ b/作业/作业/刘航宇-day12/第二题/perfect.java @@ -0,0 +1,36 @@ +import java.util.Scanner; + +public class perfect { + private static boolean isPerfect(int n) { + if (n <= 1) { + return false; + } + + int sum = 1; + for (int i = 2; i <= Math.sqrt(n); i++) { + if (n % i == 0) { + sum += i; + int other = n / i; + if (other != i && other != n) { + sum += other; + } + } + } + + return sum == n; + } + + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + System.out.print("请输入一个数字: "); + int n = in.nextInt(); + + for (int i = 2; i <= n; i++) { + if (isPerfect(i)) { + System.out.println(i); + } + } + + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day13/第一题/Circle.java b/作业/作业/刘航宇-day13/第一题/Circle.java new file mode 100644 index 0000000..b145004 --- /dev/null +++ b/作业/作业/刘航宇-day13/第一题/Circle.java @@ -0,0 +1,28 @@ +public class Circle { + private double r; + + // ! 构造方法,用于初始化半径 + public Circle(double r) { + this.r = r; + } + + // ! 计算圆的面积 + public double GetArea() { + return Math.PI * r * r; + } + + // ! 计算圆的周长 + public double GetPerimeter() { + return 2 * Math.PI * r; + } + + // ! 获取圆的半径 + public double GetRadius() { + return r; + } + + // ! 设置圆的半径 + public void SetRadius(double r) { + this.r = r; + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day13/第一题/Main.java b/作业/作业/刘航宇-day13/第一题/Main.java new file mode 100644 index 0000000..9a00934 --- /dev/null +++ b/作业/作业/刘航宇-day13/第一题/Main.java @@ -0,0 +1,22 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + System.out.print("请输入圆的半径: "); + String line = in.nextLine(); + + // 兼容终端管道可能插入的不可见字符,保留数字和符号 + line = line.replaceAll("[^0-9.+-]", ""); + double radius = Double.parseDouble(line); + + // 创建一个半径可输入的圆对象 + Circle circle = new Circle(radius); + + // 输出圆的面积和周长 + System.out.printf("圆的面积: %.2f\n", circle.GetArea()); + System.out.printf("圆的周长: %.2f\n", circle.GetPerimeter()); + + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day13/第一题/image.png b/作业/作业/刘航宇-day13/第一题/image.png new file mode 100644 index 0000000..86e4625 Binary files /dev/null and b/作业/作业/刘航宇-day13/第一题/image.png differ diff --git a/作业/作业/刘航宇-day13/第二题/Employee.java b/作业/作业/刘航宇-day13/第二题/Employee.java new file mode 100644 index 0000000..2e13ac3 --- /dev/null +++ b/作业/作业/刘航宇-day13/第二题/Employee.java @@ -0,0 +1,58 @@ +public class Employee { + private String name; + private String gender; + private String birthDate; + private double salary; + + // 无参构造方法 + public Employee() {} + + // 带参构造方法 + public Employee(String name, String gender, String birthDate, double salary) { + this.name = name; + this.gender = gender; + this.birthDate = birthDate; + this.salary = salary; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getGender() { + return gender; + } + + public void setGender(String gender) { + this.gender = gender; + } + + public String getBirthDate() { + return birthDate; + } + + public void setBirthDate(String birthDate) { + this.birthDate = birthDate; + } + + public double getSalary() { + return salary; + } + + public void setSalary(double salary) { + this.salary = salary; + } + + // 显示员工信息的方法 + public void displayInfo() { + System.out.println("员工信息:"); + System.out.println("姓名:" + name); + System.out.println("性别:" + gender); + System.out.println("出生日期:" + birthDate); + System.out.printf("工资:%.2f元\n", salary); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day13/第二题/Main.java b/作业/作业/刘航宇-day13/第二题/Main.java new file mode 100644 index 0000000..f014725 --- /dev/null +++ b/作业/作业/刘航宇-day13/第二题/Main.java @@ -0,0 +1,31 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + + // 创建Employee对象 + Employee employee = new Employee(); + + // 输入员工信息 + System.out.print("请输入员工姓名:"); + employee.setName(in.nextLine()); + + System.out.print("请输入员工性别:"); + employee.setGender(in.nextLine()); + + System.out.print("请输入出生日期(格式:YYYY-MM-DD):"); + employee.setBirthDate(in.nextLine()); + + System.out.print("请输入工资:"); + employee.setSalary(in.nextDouble()); + + // 输出空行分隔 + System.out.println(); + + // 输出员工信息 + employee.displayInfo(); + + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day13/第二题/image.png b/作业/作业/刘航宇-day13/第二题/image.png new file mode 100644 index 0000000..7c04c91 Binary files /dev/null and b/作业/作业/刘航宇-day13/第二题/image.png differ diff --git a/作业/作业/刘航宇-day14/第一题/Main.java b/作业/作业/刘航宇-day14/第一题/Main.java new file mode 100644 index 0000000..d49bc5c --- /dev/null +++ b/作业/作业/刘航宇-day14/第一题/Main.java @@ -0,0 +1,15 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + System.out.print("请输入一个整数(表示秒数):"); + int t = in.nextInt(); + Time time = new Time(); + time.Set(t); + System.out.print("转换后的时间是:"); + time.Display(); + + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day14/第一题/Time.java b/作业/作业/刘航宇-day14/第一题/Time.java new file mode 100644 index 0000000..f6e5320 --- /dev/null +++ b/作业/作业/刘航宇-day14/第一题/Time.java @@ -0,0 +1,32 @@ +public class Time { + private int h; + private int m; + private int s; + + // 构造方法 + public Time() { + this.h = 0; + this.m = 0; + this.s = 0; + } + + // 带参构造方法 + public Time(int h, int m, int s) { + this.h = h; + this.m = m; + this.s = s; + } + + // 将时间转换为总秒数 + public void Set(int t) { + this.h = t / 3600; + this.m = (t % 3600) / 60; + this.s = t % 60; + } + + // 显示时间,格式为hh:mm:ss + public void Display() { + // 使用String.format确保每位数字占两位,不足补零 + System.out.printf("%02d:%02d:%02d\n", h, m, s); + } +} diff --git a/作业/作业/刘航宇-day14/第一题/image.png b/作业/作业/刘航宇-day14/第一题/image.png new file mode 100644 index 0000000..f6d960b Binary files /dev/null and b/作业/作业/刘航宇-day14/第一题/image.png differ diff --git a/作业/作业/刘航宇-day14/第二题/LHY_Compare.java b/作业/作业/刘航宇-day14/第二题/LHY_Compare.java new file mode 100644 index 0000000..802c58d --- /dev/null +++ b/作业/作业/刘航宇-day14/第二题/LHY_Compare.java @@ -0,0 +1,30 @@ +import java.util.Scanner; + +public class LHY_Compare { + // 重载的compare方法示例 + public static int compare() { + return 0; + } + + // 比较两个整数,返回较大的值 + public static int compare(int a, int b) { + if (a > b) { + return a; + } else if (a < b) { + return b; + } else { + return 0; // 相等时返回0 + } + } + + // 比较两个字符,返回ASCII码差值的绝对值 + public static int compare(char a, char b) { + return Math.abs(a - b); + } + + // 比较两个字符串,返回较大的字符串(按字典序) + public static String compare(String a, String b) { + return (a.compareTo(b) > 0) ? a : b; + } + +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day14/第二题/Main.java b/作业/作业/刘航宇-day14/第二题/Main.java new file mode 100644 index 0000000..858b0c5 --- /dev/null +++ b/作业/作业/刘航宇-day14/第二题/Main.java @@ -0,0 +1,30 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + + // 读取整数输入 + System.out.println("请输入两个整数:"); + int num1 = in.nextInt(); + int num2 = in.nextInt(); + // 调用重载方法并输出结果 + System.out.println(LHY_Compare.compare(num1, num2)); + + // 读取字符输入 + System.out.println("请输入两个字符:"); + char char1 = in.next().charAt(0); + char char2 = in.next().charAt(0); + // 调用重载方法并输出结果 + System.out.println(LHY_Compare.compare(char1, char2)); + + // 读取字符串输入 + System.out.println("请输入两个字符串:"); + String str1 = in.next(); + String str2 = in.next(); + // 调用重载方法并输出结果 + System.out.println(LHY_Compare.compare(str1, str2)); + + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day14/第二题/image.png b/作业/作业/刘航宇-day14/第二题/image.png new file mode 100644 index 0000000..6cd4a04 Binary files /dev/null and b/作业/作业/刘航宇-day14/第二题/image.png differ diff --git a/作业/作业/刘航宇-day15/第一题/Airplane.java b/作业/作业/刘航宇-day15/第一题/Airplane.java new file mode 100644 index 0000000..6ab9158 --- /dev/null +++ b/作业/作业/刘航宇-day15/第一题/Airplane.java @@ -0,0 +1,16 @@ +public class Airplane extends Vehicle { + private double flightHeight; + + public Airplane(String name, double flightHeight) { + super(name); + this.flightHeight = flightHeight; + } + + @Override + public void travelInfo() { + System.out.println("交通工具:飞机(" + name + ")"); + System.out.println("乘坐信息:飞行高度" + flightHeight + "米,适合长途旅行"); + System.out.println("特点:速度快,效率高"); + System.out.println("------------------------"); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day15/第一题/Car.java b/作业/作业/刘航宇-day15/第一题/Car.java new file mode 100644 index 0000000..66b5fa1 --- /dev/null +++ b/作业/作业/刘航宇-day15/第一题/Car.java @@ -0,0 +1,16 @@ +public class Car extends Vehicle { + private int maxSpeed; + + public Car(String name, int maxSpeed) { + super(name); + this.maxSpeed = maxSpeed; + } + + @Override + public void travelInfo() { + System.out.println("交通工具:汽车(" + name + ")"); + System.out.println("乘坐信息:最高时速" + maxSpeed + "km/h,适合短途旅行"); + System.out.println("特点:灵活方便,点对点运输"); + System.out.println("------------------------"); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day15/第一题/Main.java b/作业/作业/刘航宇-day15/第一题/Main.java new file mode 100644 index 0000000..3e549d6 --- /dev/null +++ b/作业/作业/刘航宇-day15/第一题/Main.java @@ -0,0 +1,26 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + + Vehicle car = new Car("特斯拉Model S", 250); + Vehicle train = new Train("复兴号高铁", 16); + Vehicle airplane = new Airplane("波音747", 12500); + + // 调用各交通工具的方法 + System.out.println("=== 交通工具乘坐信息 ==="); + System.out.println(); + + car.start(); + car.travelInfo(); + + train.start(); + train.travelInfo(); + + airplane.start(); + airplane.travelInfo(); + + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day15/第一题/Train.java b/作业/作业/刘航宇-day15/第一题/Train.java new file mode 100644 index 0000000..b4184b4 --- /dev/null +++ b/作业/作业/刘航宇-day15/第一题/Train.java @@ -0,0 +1,17 @@ +public class Train extends Vehicle { + private int carriageCount; + + public Train(String name, int carriageCount) { + super(name); + this.carriageCount = carriageCount; + } + + @Override + public void travelInfo() { + System.out.println("交通工具:火车(" + name + ")"); + System.out.println("乘坐信息:" + carriageCount + "节车厢,适合中长途旅行"); + System.out.println("特点:运量大,准时可靠"); + System.out.println("------------------------"); + } + +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day15/第一题/Vehicle.java b/作业/作业/刘航宇-day15/第一题/Vehicle.java new file mode 100644 index 0000000..ad45f46 --- /dev/null +++ b/作业/作业/刘航宇-day15/第一题/Vehicle.java @@ -0,0 +1,15 @@ +public abstract class Vehicle { + public String name; + + public Vehicle(String name) { + this.name = name; + } + + // 抽象方法,子类必须实现 + public abstract void travelInfo(); + + // 具体方法,子类可以继承 + public void start() { + System.out.println(name + "开始启动..."); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day15/第一题/image.png b/作业/作业/刘航宇-day15/第一题/image.png new file mode 100644 index 0000000..39fbdf3 Binary files /dev/null and b/作业/作业/刘航宇-day15/第一题/image.png differ diff --git a/作业/作业/刘航宇-day15/第二题/DbDriver.java b/作业/作业/刘航宇-day15/第二题/DbDriver.java new file mode 100644 index 0000000..cff5b69 --- /dev/null +++ b/作业/作业/刘航宇-day15/第二题/DbDriver.java @@ -0,0 +1,5 @@ +public interface DbDriver { + void connect(); // 连接数据库方法 + void executeQuery(); // 执行查询方法 + void disconnect(); // 断开连接方法 +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day15/第二题/GoogleDriver.java b/作业/作业/刘航宇-day15/第二题/GoogleDriver.java new file mode 100644 index 0000000..aa457ff --- /dev/null +++ b/作业/作业/刘航宇-day15/第二题/GoogleDriver.java @@ -0,0 +1,17 @@ +public class GoogleDriver implements DbDriver { + @Override + public void connect() { + System.out.println("Google云数据库驱动:建立云端连接..."); + } + + @Override + public void executeQuery() { + System.out.println("Google云数据库驱动:执行分布式查询"); + } + + @Override + public void disconnect() { + System.out.println("Google云数据库驱动:关闭云连接"); + System.out.println("------------------------"); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day15/第二题/IBMDriver.java b/作业/作业/刘航宇-day15/第二题/IBMDriver.java new file mode 100644 index 0000000..b054a47 --- /dev/null +++ b/作业/作业/刘航宇-day15/第二题/IBMDriver.java @@ -0,0 +1,17 @@ +public class IBMDriver implements DbDriver { + @Override + public void connect() { + System.out.println("IBM数据库驱动:建立安全连接..."); + } + + @Override + public void executeQuery() { + System.out.println("IBM数据库驱动:执行高性能查询操作"); + } + + @Override + public void disconnect() { + System.out.println("IBM数据库驱动:安全断开连接"); + System.out.println("------------------------"); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day15/第二题/Main.java b/作业/作业/刘航宇-day15/第二题/Main.java new file mode 100644 index 0000000..c2f8a9d --- /dev/null +++ b/作业/作业/刘航宇-day15/第二题/Main.java @@ -0,0 +1,37 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + + // 使用接口的多态:同一调用输出不同内容 + UserDriver userDriver = new UserDriver(); + + // 使用接口类型声明变量 + IBMDriver IBMDriver = new IBMDriver(); + GoogleDriver GoogleDriver = new GoogleDriver(); + + // 使用IBM驱动 + System.out.println("=== 测试IBM数据库驱动 ==="); + userDriver.setDriver(IBMDriver); + userDriver.useDriver(); + + // 使用Google驱动 + System.out.println("=== 测试Google数据库驱动 ==="); + userDriver.setDriver(GoogleDriver); + userDriver.useDriver(); + + // 演示多态特性 + System.out.println("=== 多态特性演示 ==="); + DbDriver[] drivers = { + new IBMDriver(), + new GoogleDriver() + }; + for (DbDriver driver : drivers) { + userDriver.setDriver(driver); + userDriver.useDriver(); + } + + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day15/第二题/UserDriver.java b/作业/作业/刘航宇-day15/第二题/UserDriver.java new file mode 100644 index 0000000..2c266f2 --- /dev/null +++ b/作业/作业/刘航宇-day15/第二题/UserDriver.java @@ -0,0 +1,19 @@ +public class UserDriver { + private DbDriver driver; + + // 设置使用的驱动 + public void setDriver(DbDriver driver) { + this.driver = driver; + } + + // 使用驱动执行操作 + public void useDriver() { + if (driver != null) { + driver.connect(); + driver.executeQuery(); + driver.disconnect(); + } else { + System.out.println("未设置数据库驱动!"); + } + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day15/第二题/image.png b/作业/作业/刘航宇-day15/第二题/image.png new file mode 100644 index 0000000..cf45d5b Binary files /dev/null and b/作业/作业/刘航宇-day15/第二题/image.png differ diff --git a/作业/作业/刘航宇-day16/第一题/Main.java b/作业/作业/刘航宇-day16/第一题/Main.java new file mode 100644 index 0000000..b13f2ef --- /dev/null +++ b/作业/作业/刘航宇-day16/第一题/Main.java @@ -0,0 +1,24 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + + String input = in.nextLine(); // 读取一行输入 + int count = 0; + + // 遍历字符串中的每个字符 + for (int i = 0; i < input.length(); i++) { + char c = input.charAt(i); + if (Character.isDigit(c)) { + // 检查字符是否为数字 + count++; + } + } + + // 输出数字字符个数 + System.out.println(count); + + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day16/第一题/image.png b/作业/作业/刘航宇-day16/第一题/image.png new file mode 100644 index 0000000..dadf923 Binary files /dev/null and b/作业/作业/刘航宇-day16/第一题/image.png differ diff --git a/作业/作业/刘航宇-day17/第一题/Main.java b/作业/作业/刘航宇-day17/第一题/Main.java new file mode 100644 index 0000000..e4fcbef --- /dev/null +++ b/作业/作业/刘航宇-day17/第一题/Main.java @@ -0,0 +1,45 @@ +import java.util.ArrayList; +import java.util.List; +import java.util.Arrays; + +public class Main { + public static void main(String[] args) { + String s = "A1B2C3D4E5F6G7H8"; + + int[] nums = extractInts(s); + String[] letters = extractLetters(s); + + System.out.println(Arrays.toString(nums)); + System.out.println(Arrays.toString(letters)); + } + + // 提取数字到 int[] + public static int[] extractInts(String s) { + List list = new ArrayList<>(); + // 遍历字符串,提取数字字符 + for (int i = 0; i < s.length(); i++) { + char c = s.charAt(i); + if (Character.isDigit(c)) { + list.add(c - '0'); + } + } + // 将 List 转换为 int[] + int[] arr = new int[list.size()]; + for (int i = 0; i < list.size(); i++) + arr[i] = list.get(i); + return arr; + } + + // 提取字母到 String[] + public static String[] extractLetters(String s) { + List list = new ArrayList<>(); + // 遍历字符串,提取字母字符 + for (int i = 0; i < s.length(); i++) { + char c = s.charAt(i); + if (Character.isLetter(c)) { + list.add(String.valueOf(c).toUpperCase()); + } + } + return list.toArray(new String[0]); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day17/第一题/image copy.png b/作业/作业/刘航宇-day17/第一题/image copy.png new file mode 100644 index 0000000..3ad5055 Binary files /dev/null and b/作业/作业/刘航宇-day17/第一题/image copy.png differ diff --git a/作业/作业/刘航宇-day17/第二题/Main.java b/作业/作业/刘航宇-day17/第二题/Main.java new file mode 100644 index 0000000..27e91df --- /dev/null +++ b/作业/作业/刘航宇-day17/第二题/Main.java @@ -0,0 +1,21 @@ +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.Map; + +public class Main { + // 使用 Map 统计字符串数组中各元素出现次数 + public static Map count(String[] arr) { + Map freq = new LinkedHashMap<>(); // 保持键的插入顺序 + for (String s : arr) { + freq.put(s, freq.getOrDefault(s, 0) + 1); + } + return freq; + } + + public static void main(String[] args) { + String[] input = { "a", "b", "a", "b", "c", "a", "b", "c", "b" }; + Map result = count(input); + System.out.println("输入: " + Arrays.toString(input)); + System.out.println("统计结果: " + result); // 期望 {a=3, b=4, c=2} + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day17/第二题/image.png b/作业/作业/刘航宇-day17/第二题/image.png new file mode 100644 index 0000000..19996e0 Binary files /dev/null and b/作业/作业/刘航宇-day17/第二题/image.png differ diff --git a/作业/作业/刘航宇-day18/第一题/Complex.java b/作业/作业/刘航宇-day18/第一题/Complex.java new file mode 100644 index 0000000..33fa7af --- /dev/null +++ b/作业/作业/刘航宇-day18/第一题/Complex.java @@ -0,0 +1,25 @@ +public class Complex { + public int real; + public int imag; + + public Complex(int real, int imag) { + this.real = real; + this.imag = imag; + } + + public Complex add(Complex other) { + return new Complex(this.real + other.real, this.imag + other.imag); + } + + public Complex sub(Complex other) { + return new Complex(this.real - other.real, this.imag - other.imag); + } + + // 输出形如 8+6i 或 8-6i + @Override + public String toString() { + String sign = imag >= 0 ? "+" : "-"; + int absImag = Math.abs(imag); + return real + sign + absImag + "i"; + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day18/第一题/ComplexCalc.java b/作业/作业/刘航宇-day18/第一题/ComplexCalc.java new file mode 100644 index 0000000..14e206f --- /dev/null +++ b/作业/作业/刘航宇-day18/第一题/ComplexCalc.java @@ -0,0 +1,87 @@ +import java.util.Scanner; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class ComplexCalc { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + String line = in.nextLine().trim(); + in.close(); + + // 支持三种输入: + // 1) "3 2 + 5 4" -> (3+2i) op (5+4i) + // 2) "32 + 54" -> (3+2i) op (5+4i) + // 3) "3+2i + 5+4i" -> 常见复数格式(运算符两侧有空格) + + ParseResult pr = parse(line); + if (pr == null) { + System.out.println("输入格式不正确"); + return; + } + + Complex a = pr.left; + Complex b = pr.right; + Complex res = pr.op == '+' ? a.add(b) : a.sub(b); + System.out.println(res.toString()); + } + + static class ParseResult { + Complex left; + Complex right; + char op; // '+' or '-' + ParseResult(Complex l, Complex r, char o) { left = l; right = r; op = o; } + } + + private static ParseResult parse(String line) { + // 尝试格式1:a b op c d + String[] tokens = line.split("\\s+"); + if (tokens.length == 5 && isSign(tokens[2])) { + try { + int r1 = Integer.parseInt(tokens[0]); + int i1 = Integer.parseInt(tokens[1]); + int r2 = Integer.parseInt(tokens[3]); + int i2 = Integer.parseInt(tokens[4]); + return new ParseResult(new Complex(r1, i1), new Complex(r2, i2), tokens[2].charAt(0)); + } catch (NumberFormatException ignored) {} + } + + // 尝试格式2:ab op cd(各为两个数字) + if (tokens.length == 3 && isSign(tokens[1]) && tokens[0].matches("\\d{2}") && tokens[2].matches("\\d{2}")) { + int r1 = tokens[0].charAt(0) - '0'; + int i1 = tokens[0].charAt(1) - '0'; + int r2 = tokens[2].charAt(0) - '0'; + int i2 = tokens[2].charAt(1) - '0'; + return new ParseResult(new Complex(r1, i1), new Complex(r2, i2), tokens[1].charAt(0)); + } + + // 尝试格式3:a+bi op c+di(运算符两侧必须有空格) + if (line.contains(" + ") || line.contains(" - ")) { + char op = line.contains(" + ") ? '+' : '-'; + String[] parts = line.split("\\s+[+\\-]\\s+"); + if (parts.length == 2) { + Complex left = parseAPlusBi(parts[0]); + Complex right = parseAPlusBi(parts[1]); + if (left != null && right != null) { + return new ParseResult(left, right, op); + } + } + } + return null; + } + + private static boolean isSign(String s) { + return s.length() == 1 && (s.charAt(0) == '+' || s.charAt(0) == '-'); + } + + private static Complex parseAPlusBi(String s) { + s = s.trim(); + Matcher m = Pattern.compile("^([+-]?\\d+)\\s*([+\\-])\\s*([+-]?\\d+)i$").matcher(s); + if (m.matches()) { + int r = Integer.parseInt(m.group(1)); + int sign = m.group(2).charAt(0) == '-' ? -1 : 1; + int i = sign * Integer.parseInt(m.group(3)); + return new Complex(r, i); + } + return null; + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day18/第一题/image.png b/作业/作业/刘航宇-day18/第一题/image.png new file mode 100644 index 0000000..8883363 Binary files /dev/null and b/作业/作业/刘航宇-day18/第一题/image.png differ diff --git a/作业/作业/刘航宇-day18/第二题/DateApp.java b/作业/作业/刘航宇-day18/第二题/DateApp.java new file mode 100644 index 0000000..e486742 --- /dev/null +++ b/作业/作业/刘航宇-day18/第二题/DateApp.java @@ -0,0 +1,18 @@ +import java.util.Scanner; + +public class DateApp { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + String line = in.nextLine().trim(); // 形如 2020-10-10 + in.close(); + + String[] parts = line.split("-"); + int y = Integer.parseInt(parts[0]); + int m = Integer.parseInt(parts[1]); + int d = Integer.parseInt(parts[2]); + + MyDate date = new MyDate(); + date.set(y, m, d); + date.print(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day18/第二题/MyDate.java b/作业/作业/刘航宇-day18/第二题/MyDate.java new file mode 100644 index 0000000..2d1f089 --- /dev/null +++ b/作业/作业/刘航宇-day18/第二题/MyDate.java @@ -0,0 +1,16 @@ +public class MyDate { + private int year; + private int month; + private int day; + + public void set(int year, int month, int day) { + this.year = year; + this.month = month; + this.day = day; + } + + public void print() { + System.out.println("输出重置后的时间:"); + System.out.println(year + ":" + month + ":" + day); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day18/第二题/image.png b/作业/作业/刘航宇-day18/第二题/image.png new file mode 100644 index 0000000..55606f3 Binary files /dev/null and b/作业/作业/刘航宇-day18/第二题/image.png differ diff --git a/作业/作业/刘航宇-day19/第一题/Main.java b/作业/作业/刘航宇-day19/第一题/Main.java new file mode 100644 index 0000000..f83a8f7 --- /dev/null +++ b/作业/作业/刘航宇-day19/第一题/Main.java @@ -0,0 +1,37 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + + // 5x5 + int Shuzu[][] = new int[5][5]; + for (int i = 0; i < 5; i++) { + for (int j = 0; j < 5; j++) { + Shuzu[i][j] = in.nextInt(); + } + } + + // m n + int m, n; + m = in.nextInt(); + n = in.nextInt(); + + // + int temp[]=new int[5]; + for (int j = 0; j < 5; j++) { + temp[j] = Shuzu[m][j]; + Shuzu[m][j] = Shuzu[n][j]; + Shuzu[n][j] = temp[j]; + } + + for (int i = 0; i < 5; i++) { + for (int j = 0; j < 5; j++) { + System.out.print(Shuzu[i][j] + " "); + } + System.out.println(); + } + + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day19/第一题/image.png b/作业/作业/刘航宇-day19/第一题/image.png new file mode 100644 index 0000000..f820382 Binary files /dev/null and b/作业/作业/刘航宇-day19/第一题/image.png differ diff --git a/作业/作业/刘航宇-day19/第二题/DateApp.java b/作业/作业/刘航宇-day19/第二题/DateApp.java new file mode 100644 index 0000000..e486742 --- /dev/null +++ b/作业/作业/刘航宇-day19/第二题/DateApp.java @@ -0,0 +1,18 @@ +import java.util.Scanner; + +public class DateApp { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + String line = in.nextLine().trim(); // 形如 2020-10-10 + in.close(); + + String[] parts = line.split("-"); + int y = Integer.parseInt(parts[0]); + int m = Integer.parseInt(parts[1]); + int d = Integer.parseInt(parts[2]); + + MyDate date = new MyDate(); + date.set(y, m, d); + date.print(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day19/第二题/MyDate.java b/作业/作业/刘航宇-day19/第二题/MyDate.java new file mode 100644 index 0000000..2d1f089 --- /dev/null +++ b/作业/作业/刘航宇-day19/第二题/MyDate.java @@ -0,0 +1,16 @@ +public class MyDate { + private int year; + private int month; + private int day; + + public void set(int year, int month, int day) { + this.year = year; + this.month = month; + this.day = day; + } + + public void print() { + System.out.println("输出重置后的时间:"); + System.out.println(year + ":" + month + ":" + day); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day19/第二题/image.png b/作业/作业/刘航宇-day19/第二题/image.png new file mode 100644 index 0000000..55606f3 Binary files /dev/null and b/作业/作业/刘航宇-day19/第二题/image.png differ diff --git a/作业/作业/刘航宇-day2/第一题/MaxNum.java b/作业/作业/刘航宇-day2/第一题/MaxNum.java new file mode 100644 index 0000000..d0d357a --- /dev/null +++ b/作业/作业/刘航宇-day2/第一题/MaxNum.java @@ -0,0 +1,36 @@ +import java.util.Scanner; + +public class MaxNum { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int a = in.nextInt(); + int b = in.nextInt(); + int c = in.nextInt(); + int max = 0; + if (a>=b) + { + if (a>=c) + { + max = a; + } + else + { + max = c; + } + } + else + { + if (b>=c) + { + max = b; + } + else + { + max = c; + } + } + System.out.println("max="+max); + in.close(); + } + +} diff --git a/作业/作业/刘航宇-day2/第一题/屏幕截图 2025-10-28 201311.png b/作业/作业/刘航宇-day2/第一题/屏幕截图 2025-10-28 201311.png new file mode 100644 index 0000000..f93216f Binary files /dev/null and b/作业/作业/刘航宇-day2/第一题/屏幕截图 2025-10-28 201311.png differ diff --git a/作业/作业/刘航宇-day2/第二题/DaFen.java b/作业/作业/刘航宇-day2/第二题/DaFen.java new file mode 100644 index 0000000..5d5bfc6 --- /dev/null +++ b/作业/作业/刘航宇-day2/第二题/DaFen.java @@ -0,0 +1,29 @@ +import java.util.Scanner; + +public class DaFen { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int n = in.nextInt(); + int score = 0; + if (n<0 || n>40) + { + System.out.println("做对题目数量有误"); + } + else { + if (n <= 10) { + score = n * 6; + System.out.println("score=" + score); + } + if (n > 10 && n <= 20) { + score = 60 + (n - 10) * 2; + System.out.println("score=" + score); + } + if (n > 20) { + score = 80 + (n - 20); + System.out.println("score=" + score); + } + } + in.close(); + } + +} diff --git a/作业/作业/刘航宇-day2/第二题/屏幕截图 2025-10-28 202218.png b/作业/作业/刘航宇-day2/第二题/屏幕截图 2025-10-28 202218.png new file mode 100644 index 0000000..856a174 Binary files /dev/null and b/作业/作业/刘航宇-day2/第二题/屏幕截图 2025-10-28 202218.png differ diff --git a/作业/作业/刘航宇-day20/第一题/Main.java b/作业/作业/刘航宇-day20/第一题/Main.java new file mode 100644 index 0000000..13dbd17 --- /dev/null +++ b/作业/作业/刘航宇-day20/第一题/Main.java @@ -0,0 +1,64 @@ +import java.util.Scanner; + +public class Main { + + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int rows = 5, cols = 5; // 可灵活调整矩阵大小 + int[][] matrix = new int[rows][cols]; + + System.out.println("请输入" + rows + "×" + cols + "二维数组的元素:"); + for (int i = 0; i < rows; i++) { + for (int j = 0; j < cols; j++) { + matrix[i][j] = in.nextInt(); + } + } + + findSaddlePoints(matrix); + in.close(); + } + + public static void findSaddlePoints(int[][] matrix) { + int rows = matrix.length; + int cols = matrix[0].length; + boolean found = false; + + // 预计算每行的最大值 + int[] rowMaxs = new int[rows]; + for (int i = 0; i < rows; i++) { + int max = matrix[i][0]; + for (int j = 1; j < cols; j++) { + if (matrix[i][j] > max) { + max = matrix[i][j]; + } + } + rowMaxs[i] = max; + } + + // 预计算每列的最小值 + int[] colMins = new int[cols]; + for (int j = 0; j < cols; j++) { + int min = matrix[0][j]; + for (int i = 1; i < rows; i++) { + if (matrix[i][j] < min) { + min = matrix[i][j]; + } + } + colMins[j] = min; + } + + // 查找鞍点:行最大值且列最小值 + for (int i = 0; i < rows; i++) { + for (int j = 0; j < cols; j++) { + if (matrix[i][j] == rowMaxs[i] && matrix[i][j] == colMins[j]) { + System.out.println("鞍点位置: (" + i + ", " + j + "), 值: " + matrix[i][j]); + found = true; + } + } + } + + if (!found) { + System.out.println("未找到鞍点"); + } + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day20/第一题/image.png b/作业/作业/刘航宇-day20/第一题/image.png new file mode 100644 index 0000000..e69de29 diff --git a/作业/作业/刘航宇-day20/第三题/Main.java b/作业/作业/刘航宇-day20/第三题/Main.java new file mode 100644 index 0000000..73449fa --- /dev/null +++ b/作业/作业/刘航宇-day20/第三题/Main.java @@ -0,0 +1,48 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + + // 存储26个字母的出现次数 + int[] frequency = new int[26]; + int maxFrequency = 0; + + // 读取4行文本并统计频率 + for (int i = 0; i < 4; i++) { + String line = scanner.nextLine().toUpperCase(); + for (char c : line.toCharArray()) { + if (c >= 'A' && c <= 'Z') { + int index = c - 'A'; + frequency[index]++; + if (frequency[index] > maxFrequency) { + maxFrequency = frequency[index]; + } + } + } + } + + // 绘制垂直直方图 + for (int row = maxFrequency; row > 0; row--) { + StringBuilder line = new StringBuilder(); + for (int i = 0; i < 26; i++) { + if (frequency[i] >= row) { + line.append("* "); + } else { + line.append(" "); + } + } + // 去除行尾空格后输出 + System.out.println(line.toString().replaceAll("\\s+$", "")); + } + + // 输出字母行 + StringBuilder alphabetLine = new StringBuilder(); + for (char c = 'A'; c <= 'Z'; c++) { + alphabetLine.append(c).append(" "); + } + System.out.println(alphabetLine.toString().trim()); + + scanner.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day20/第三题/image.png b/作业/作业/刘航宇-day20/第三题/image.png new file mode 100644 index 0000000..b8bb687 Binary files /dev/null and b/作业/作业/刘航宇-day20/第三题/image.png differ diff --git a/作业/作业/刘航宇-day20/第二题/Main.java b/作业/作业/刘航宇-day20/第二题/Main.java new file mode 100644 index 0000000..4bb9ede --- /dev/null +++ b/作业/作业/刘航宇-day20/第二题/Main.java @@ -0,0 +1,30 @@ +import java.util.Arrays; +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + + // 处理多组测试数据 + while (scanner.hasNextInt()) { + int n = scanner.nextInt(); + int[] numbers = new int[n]; + + // 读取n个整数 + for (int i = 0; i < n; i++) { + numbers[i] = scanner.nextInt(); + } + + // 对数组进行排序 + Arrays.sort(numbers); + + // 输出排序结果 + for (int i = 0; i < n; i++) { + System.out.print(numbers[i] + " "); + } + System.out.println(); // 换行 + } + + scanner.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day20/第二题/image.png b/作业/作业/刘航宇-day20/第二题/image.png new file mode 100644 index 0000000..e567e24 Binary files /dev/null and b/作业/作业/刘航宇-day20/第二题/image.png differ diff --git a/作业/作业/刘航宇-day21/第一题/Main.java b/作业/作业/刘航宇-day21/第一题/Main.java new file mode 100644 index 0000000..23496e6 --- /dev/null +++ b/作业/作业/刘航宇-day21/第一题/Main.java @@ -0,0 +1,28 @@ +import java.util.Scanner; + +public class Main { + public static boolean isPrime(int number) { + if (number <= 1) { + return false; + } + for (int i = 2; i <= Math.sqrt(number); i++) { + if (number % i == 0) { + return false; + } + } + return true; + } + + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + System.out.print("请输入一个整数:"); + int number = in.nextInt(); + if (isPrime(number)) { + System.out.println(number + "是素数"); + } else { + System.out.println(number + "不是素数"); + } + + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day21/第一题/image.png b/作业/作业/刘航宇-day21/第一题/image.png new file mode 100644 index 0000000..b43254c Binary files /dev/null and b/作业/作业/刘航宇-day21/第一题/image.png differ diff --git a/作业/作业/刘航宇-day21/第三题/Main.java b/作业/作业/刘航宇-day21/第三题/Main.java new file mode 100644 index 0000000..97de093 --- /dev/null +++ b/作业/作业/刘航宇-day21/第三题/Main.java @@ -0,0 +1,20 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int n = in.nextInt(); + in.close(); + + long res = 1L; + for (int i = 2; i <= n; i++) { + res *= i; + while (res % 10 == 0) { + res /= 10; // 去除产生的0 + } + res %= 10000000L; // 保留足够位数避免溢出 + } + + System.out.println(res % 10); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day21/第三题/image.png b/作业/作业/刘航宇-day21/第三题/image.png new file mode 100644 index 0000000..ed38962 Binary files /dev/null and b/作业/作业/刘航宇-day21/第三题/image.png differ diff --git a/作业/作业/刘航宇-day21/第二题/InsertSorted.java b/作业/作业/刘航宇-day21/第二题/InsertSorted.java new file mode 100644 index 0000000..9969582 --- /dev/null +++ b/作业/作业/刘航宇-day21/第二题/InsertSorted.java @@ -0,0 +1,33 @@ +import java.util.Scanner; + +public class InsertSorted { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + + int[] arr = new int[10]; // 容纳插入后的10个元素 + for (int i = 0; i < 9; i++) { + if (sc.hasNextInt()) { + arr[i] = sc.nextInt(); + } + } + int x = sc.nextInt(); // 待插入的数字 + sc.close(); + + int pos = 9; // 默认插到末尾 + for (int i = 0; i < 9; i++) { + if (x <= arr[i]) { + pos = i; + break; + } + } + + for (int i = 9; i > pos; i--) { + arr[i] = arr[i - 1]; + } + arr[pos] = x; + + for (int i = 0; i < 10; i++) { + System.out.println(arr[i]); + } + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day21/第二题/image.png b/作业/作业/刘航宇-day21/第二题/image.png new file mode 100644 index 0000000..9f16f17 Binary files /dev/null and b/作业/作业/刘航宇-day21/第二题/image.png differ diff --git a/作业/作业/刘航宇-day22/第一题/Main.java b/作业/作业/刘航宇-day22/第一题/Main.java new file mode 100644 index 0000000..875dd22 --- /dev/null +++ b/作业/作业/刘航宇-day22/第一题/Main.java @@ -0,0 +1,27 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + String n = in.next(); + int s = in.nextInt(); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < n.length(); i++) { + char c = n.charAt(i); + while (s > 0 && sb.length() > 0 && sb.charAt(sb.length() - 1) > c) { + sb.deleteCharAt(sb.length() - 1); + s--; + } + sb.append(c); + } + if (s > 0) { + int newLen = Math.max(0, sb.length() - s); + sb.setLength(newLen); + } + int idx = 0; + while (idx < sb.length() && sb.charAt(idx) == '0') idx++; + String res = idx == sb.length() ? "0" : sb.substring(idx); + System.out.println(res); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day22/第一题/image.png b/作业/作业/刘航宇-day22/第一题/image.png new file mode 100644 index 0000000..c466d5d Binary files /dev/null and b/作业/作业/刘航宇-day22/第一题/image.png differ diff --git a/作业/作业/刘航宇-day23/第一题/Main.java b/作业/作业/刘航宇-day23/第一题/Main.java new file mode 100644 index 0000000..0bc3e9c --- /dev/null +++ b/作业/作业/刘航宇-day23/第一题/Main.java @@ -0,0 +1,34 @@ +import java.util.Scanner; + +public class Main { + static int gcd(int a, int b) { + a = Math.abs(a); + b = Math.abs(b); + while (b != 0) { + int t = a % b; + a = b; + b = t; + } + return a; + } + + static long lcm(int a, int b) { + if (a == 0 || b == 0) return 0L; + int g = gcd(a, b); + long x = (long) a / g; + long y = (long) b; + long res = x * y; + if (res < 0) res = -res; + return res; + } + + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int a = in.nextInt(); + int b = in.nextInt(); + int g = gcd(a, b); + long l = lcm(a, b); + System.out.println(g + " " + l); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day23/第一题/image.png b/作业/作业/刘航宇-day23/第一题/image.png new file mode 100644 index 0000000..58a16b4 Binary files /dev/null and b/作业/作业/刘航宇-day23/第一题/image.png differ diff --git a/作业/作业/刘航宇-day23/第三题/Main.java b/作业/作业/刘航宇-day23/第三题/Main.java new file mode 100644 index 0000000..3c57726 --- /dev/null +++ b/作业/作业/刘航宇-day23/第三题/Main.java @@ -0,0 +1,32 @@ +import java.util.Scanner; +import java.math.BigInteger; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int N = in.nextInt(); + int K = in.nextInt(); + String s = in.next(); + BigInteger[][] dp = new BigInteger[N + 1][K + 2]; + for (int i = 1; i <= N; i++) { + dp[i][1] = new BigInteger(s.substring(0, i)); + } + for (int p = 2; p <= K + 1; p++) { + for (int i = p; i <= N; i++) { + BigInteger best = null; + for (int j = p - 1; j <= i - 1; j++) { + if (dp[j][p - 1] == null) + continue; + BigInteger seg = new BigInteger(s.substring(j, i)); + BigInteger cand = dp[j][p - 1].multiply(seg); + if (best == null || cand.compareTo(best) > 0) + best = cand; + } + dp[i][p] = best; + } + } + BigInteger ans = dp[N][K + 1]; + System.out.println(ans == null ? "0" : ans.toString()); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day23/第三题/image.png b/作业/作业/刘航宇-day23/第三题/image.png new file mode 100644 index 0000000..59be5cc Binary files /dev/null and b/作业/作业/刘航宇-day23/第三题/image.png differ diff --git a/作业/作业/刘航宇-day23/第二题/Main.java b/作业/作业/刘航宇-day23/第二题/Main.java new file mode 100644 index 0000000..0c019ed --- /dev/null +++ b/作业/作业/刘航宇-day23/第二题/Main.java @@ -0,0 +1,16 @@ +import java.util.Scanner; + +public class Main { + + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int n = in.nextInt(); + final double PI = 3.1415; + for (int i = 0; i < n; i++) { + double r = in.nextDouble(); + double area = PI * r * r; + System.out.printf("%.6f\n", area); + } + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day23/第二题/image.png b/作业/作业/刘航宇-day23/第二题/image.png new file mode 100644 index 0000000..d90090d Binary files /dev/null and b/作业/作业/刘航宇-day23/第二题/image.png differ diff --git a/作业/作业/刘航宇-day24/第一题/Main.java b/作业/作业/刘航宇-day24/第一题/Main.java new file mode 100644 index 0000000..cac0f88 --- /dev/null +++ b/作业/作业/刘航宇-day24/第一题/Main.java @@ -0,0 +1,19 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int n = in.nextInt(); + int[] a = new int[n]; + for (int i = 0; i < n; i++) { + a[i] = in.nextInt(); + } + int m = in.nextInt(); + int cnt = 0; + for (int i = 0; i < n; i++) { + if (a[i] == m) cnt++; + } + System.out.println(cnt); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day24/第一题/image.png b/作业/作业/刘航宇-day24/第一题/image.png new file mode 100644 index 0000000..f1e6ee4 Binary files /dev/null and b/作业/作业/刘航宇-day24/第一题/image.png differ diff --git a/作业/作业/刘航宇-day24/第三题/Main.java b/作业/作业/刘航宇-day24/第三题/Main.java new file mode 100644 index 0000000..1178901 --- /dev/null +++ b/作业/作业/刘航宇-day24/第三题/Main.java @@ -0,0 +1,33 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int n = in.nextInt(); + boolean found = false; + for (int a = 1; a <= 9; a++) { + for (int b = 0; b <= 9; b++) { + for (int c = 0; c <= 9; c++) { + if (2 * a + 2 * b + c == n) { + int x = a * 10000 + b * 1000 + c * 100 + b * 10 + a; + System.out.println(x); + found = true; + } + } + } + } + for (int a = 1; a <= 9; a++) { + for (int b = 0; b <= 9; b++) { + for (int c = 0; c <= 9; c++) { + if (2 * (a + b + c) == n) { + int y = a * 100000 + b * 10000 + c * 1000 + c * 100 + b * 10 + a; + System.out.println(y); + found = true; + } + } + } + } + if (!found) System.out.println(-1); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day24/第三题/image.png b/作业/作业/刘航宇-day24/第三题/image.png new file mode 100644 index 0000000..ab354d3 Binary files /dev/null and b/作业/作业/刘航宇-day24/第三题/image.png differ diff --git a/作业/作业/刘航宇-day24/第二题/Main.java b/作业/作业/刘航宇-day24/第二题/Main.java new file mode 100644 index 0000000..51d4e6e --- /dev/null +++ b/作业/作业/刘航宇-day24/第二题/Main.java @@ -0,0 +1,23 @@ +import java.util.Scanner; +import java.util.Arrays; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + while (in.hasNextInt()) { + int N = in.nextInt(); + if (N == 0) break; + int[] req = new int[N]; + for (int i = 0; i < N; i++) { + int voters = in.nextInt(); + req[i] = voters / 2 + 1; + } + Arrays.sort(req); + int need = N / 2 + 1; + int sum = 0; + for (int i = 0; i < need; i++) sum += req[i]; + System.out.println(sum); + } + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day24/第二题/image.png b/作业/作业/刘航宇-day24/第二题/image.png new file mode 100644 index 0000000..5f4f5d3 Binary files /dev/null and b/作业/作业/刘航宇-day24/第二题/image.png differ diff --git a/作业/作业/刘航宇-day25/第一题/Main.java b/作业/作业/刘航宇-day25/第一题/Main.java new file mode 100644 index 0000000..2a41351 --- /dev/null +++ b/作业/作业/刘航宇-day25/第一题/Main.java @@ -0,0 +1,14 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int n = in.nextInt(); + int f = 0; + for (int i = 2; i <= n; i++) { + f = (f + 3) % i; + } + System.out.println(f + 1); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day25/第一题/image.png b/作业/作业/刘航宇-day25/第一题/image.png new file mode 100644 index 0000000..918ba94 Binary files /dev/null and b/作业/作业/刘航宇-day25/第一题/image.png differ diff --git a/作业/作业/刘航宇-day25/第三题/Main.java b/作业/作业/刘航宇-day25/第三题/Main.java new file mode 100644 index 0000000..6a4ab8e --- /dev/null +++ b/作业/作业/刘航宇-day25/第三题/Main.java @@ -0,0 +1,21 @@ +import java.util.Scanner; +import java.math.BigInteger; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int n = Integer.parseInt(in.next()); + if (n == 0) { + System.out.println(0); + in.close(); + return; + } + BigInteger tenPow = BigInteger.TEN.pow(n - 1); + BigInteger eightPow = BigInteger.valueOf(8).pow(n - 1); + BigInteger part1 = BigInteger.valueOf(9).multiply(tenPow); + BigInteger part2 = BigInteger.valueOf(7).multiply(eightPow); + BigInteger res = part1.add(part2).divide(BigInteger.valueOf(2)); + System.out.println(res.toString()); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day25/第三题/image.png b/作业/作业/刘航宇-day25/第三题/image.png new file mode 100644 index 0000000..d6a38fd Binary files /dev/null and b/作业/作业/刘航宇-day25/第三题/image.png differ diff --git a/作业/作业/刘航宇-day25/第二题/Main.java b/作业/作业/刘航宇-day25/第二题/Main.java new file mode 100644 index 0000000..8a6bffa --- /dev/null +++ b/作业/作业/刘航宇-day25/第二题/Main.java @@ -0,0 +1,38 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int n = in.nextInt(); + long s1 = 0, s2 = 0, s3 = 0; + String bestId = ""; + String bestName = ""; + int ba = 0, bb = 0, bc = 0; + int best = -1; + for (int i = 0; i < n; i++) { + String id = in.next(); + String name = in.next(); + int a = in.nextInt(); + int b = in.nextInt(); + int c = in.nextInt(); + s1 += a; + s2 += b; + s3 += c; + int tot = a + b + c; + if (tot > best) { + best = tot; + bestId = id; + bestName = name; + ba = a; + bb = b; + bc = c; + } + } + int avg1 = (int) (s1 / n); + int avg2 = (int) (s2 / n); + int avg3 = (int) (s3 / n); + System.out.println(avg1 + " " + avg2 + " " + avg3); + System.out.println(bestId + " " + bestName + " " + ba + " " + bb + " " + bc); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day25/第二题/image.png b/作业/作业/刘航宇-day25/第二题/image.png new file mode 100644 index 0000000..12ec310 Binary files /dev/null and b/作业/作业/刘航宇-day25/第二题/image.png differ diff --git a/作业/作业/刘航宇-day26/第一题/Main.java b/作业/作业/刘航宇-day26/第一题/Main.java new file mode 100644 index 0000000..bf669f0 --- /dev/null +++ b/作业/作业/刘航宇-day26/第一题/Main.java @@ -0,0 +1,37 @@ +import java.util.Scanner; +import java.util.ArrayList; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int a = in.nextInt(); + String n = in.next(); + int b = in.nextInt(); + long value = 0L; + for (int i = 0; i < n.length(); i++) { + char ch = n.charAt(i); + int v; + if (ch >= '0' && ch <= '9') v = ch - '0'; + else if (ch >= 'a' && ch <= 'f') v = ch - 'a' + 10; + else if (ch >= 'A' && ch <= 'F') v = ch - 'A' + 10; + else v = 0; + value = value * a + v; + } + if (value == 0) { + System.out.println("0"); + in.close(); + return; + } + ArrayList digits = new ArrayList<>(); + while (value > 0) { + int r = (int)(value % b); + char d = (char)(r < 10 ? ('0' + r) : ('A' + (r - 10))); + digits.add(d); + value /= b; + } + StringBuilder out = new StringBuilder(); + for (int i = digits.size() - 1; i >= 0; i--) out.append(digits.get(i)); + System.out.println(out.toString()); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day26/第一题/image.png b/作业/作业/刘航宇-day26/第一题/image.png new file mode 100644 index 0000000..26f5ea6 Binary files /dev/null and b/作业/作业/刘航宇-day26/第一题/image.png differ diff --git a/作业/作业/刘航宇-day27/第一题/Main.java b/作业/作业/刘航宇-day27/第一题/Main.java new file mode 100644 index 0000000..cc460b0 --- /dev/null +++ b/作业/作业/刘航宇-day27/第一题/Main.java @@ -0,0 +1,32 @@ +import java.util.Scanner; + +public class Main { + static boolean isPrime(int x) { + if (x < 2) return false; + if (x % 2 == 0) return x == 2; + for (int i = 3; i * i <= x; i += 2) { + if (x % i == 0) return false; + } + return true; + } + + static boolean isPalin(int x) { + String s = Integer.toString(x); + int i = 0, j = s.length() - 1; + while (i < j) { + if (s.charAt(i++) != s.charAt(j--)) return false; + } + return true; + } + + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int n = in.nextInt(); + int cnt = 0; + for (int i = 11; i <= n; i++) { + if (isPrime(i) && isPalin(i)) cnt++; + } + System.out.println(cnt); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day27/第一题/image.png b/作业/作业/刘航宇-day27/第一题/image.png new file mode 100644 index 0000000..44487c9 Binary files /dev/null and b/作业/作业/刘航宇-day27/第一题/image.png differ diff --git a/作业/作业/刘航宇-day27/第三题/Main.java b/作业/作业/刘航宇-day27/第三题/Main.java new file mode 100644 index 0000000..863ee4b --- /dev/null +++ b/作业/作业/刘航宇-day27/第三题/Main.java @@ -0,0 +1,15 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int[] h = new int[10]; + for (int i = 0; i < 10; i++) h[i] = in.nextInt(); + int reach = in.nextInt(); + int limit = reach + 30; + int count = 0; + for (int i = 0; i < 10; i++) if (h[i] <= limit) count++; + System.out.println(count); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day27/第三题/image.png b/作业/作业/刘航宇-day27/第三题/image.png new file mode 100644 index 0000000..a8d92ff Binary files /dev/null and b/作业/作业/刘航宇-day27/第三题/image.png differ diff --git a/作业/作业/刘航宇-day28/第一题/Main.java b/作业/作业/刘航宇-day28/第一题/Main.java new file mode 100644 index 0000000..2286536 --- /dev/null +++ b/作业/作业/刘航宇-day28/第一题/Main.java @@ -0,0 +1,18 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + String s = in.nextLine(); + int n = s.length(); + StringBuilder sb = new StringBuilder(n); + for (int i = 0; i < n - 1; i++) { + char c = (char) (s.charAt(i) + s.charAt(i + 1)); + sb.append(c); + } + char last = (char) (s.charAt(n - 1) + s.charAt(0)); + sb.append(last); + System.out.println(sb.toString()); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day28/第一题/image.png b/作业/作业/刘航宇-day28/第一题/image.png new file mode 100644 index 0000000..c118098 Binary files /dev/null and b/作业/作业/刘航宇-day28/第一题/image.png differ diff --git a/作业/作业/刘航宇-day29/第一题/Main.java b/作业/作业/刘航宇-day29/第一题/Main.java new file mode 100644 index 0000000..dcd104d --- /dev/null +++ b/作业/作业/刘航宇-day29/第一题/Main.java @@ -0,0 +1,12 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int a = in.nextInt(); + int b = in.nextInt(); + double ans = (double) a / b; + System.out.printf("%.9f\n", ans); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day29/第一题/image.png b/作业/作业/刘航宇-day29/第一题/image.png new file mode 100644 index 0000000..99acceb Binary files /dev/null and b/作业/作业/刘航宇-day29/第一题/image.png differ diff --git a/作业/作业/刘航宇-day29/第三题/Main.java b/作业/作业/刘航宇-day29/第三题/Main.java new file mode 100644 index 0000000..d272c6d --- /dev/null +++ b/作业/作业/刘航宇-day29/第三题/Main.java @@ -0,0 +1,20 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + String s = in.next(); + boolean ok = true; + if (s.length() == 0) ok = false; + else if (s.charAt(0) >= '0' && s.charAt(0) <= '9') ok = false; + else { + for (int i = 0; i < s.length(); i++) { + char c = s.charAt(i); + boolean allowed = (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || c == '_'; + if (!allowed) { ok = false; break; } + } + } + System.out.println(ok ? "yes" : "no"); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day29/第三题/image.png b/作业/作业/刘航宇-day29/第三题/image.png new file mode 100644 index 0000000..3263395 Binary files /dev/null and b/作业/作业/刘航宇-day29/第三题/image.png differ diff --git a/作业/作业/刘航宇-day29/第二题/Main.java b/作业/作业/刘航宇-day29/第二题/Main.java new file mode 100644 index 0000000..9345771 --- /dev/null +++ b/作业/作业/刘航宇-day29/第二题/Main.java @@ -0,0 +1,26 @@ +import java.util.Scanner; +import java.math.BigInteger; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + String s = in.next().trim(); + int n = s.length(); + BigInteger x = new BigInteger(s); + String ss = s + s; + boolean ok = true; + for (int k = 1; k <= n; k++) { + String p = x.multiply(BigInteger.valueOf(k)).toString(); + if (p.length() > n) { ok = false; break; } + if (p.length() < n) { + StringBuilder pad = new StringBuilder(n); + for (int i = p.length(); i < n; i++) pad.append('0'); + pad.append(p); + p = pad.toString(); + } + if (ss.indexOf(p) == -1) { ok = false; break; } + } + System.out.println(ok ? 1 : 0); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day29/第二题/image.png b/作业/作业/刘航宇-day29/第二题/image.png new file mode 100644 index 0000000..752199f Binary files /dev/null and b/作业/作业/刘航宇-day29/第二题/image.png differ diff --git a/作业/作业/刘航宇-day3/第一题/DivideNum.java b/作业/作业/刘航宇-day3/第一题/DivideNum.java new file mode 100644 index 0000000..8101efe --- /dev/null +++ b/作业/作业/刘航宇-day3/第一题/DivideNum.java @@ -0,0 +1,18 @@ +import java.util.Scanner; + +public class DivideNum { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int num = 0; + System.out.println("请输入一个非负三位整数:"); + num = in.nextInt(); + int hundreds = num / 100; + int tens = (num / 10) % 10; + int units = num % 10; + System.out.println(hundreds); + System.out.println(tens); + System.out.println(units); + + in.close(); + } +} diff --git a/作业/作业/刘航宇-day3/第一题/屏幕截图 2025-10-30 192803.png b/作业/作业/刘航宇-day3/第一题/屏幕截图 2025-10-30 192803.png new file mode 100644 index 0000000..1b7cf31 Binary files /dev/null and b/作业/作业/刘航宇-day3/第一题/屏幕截图 2025-10-30 192803.png differ diff --git a/作业/作业/刘航宇-day3/第二题/ca.java b/作业/作业/刘航宇-day3/第二题/ca.java new file mode 100644 index 0000000..d552da8 --- /dev/null +++ b/作业/作业/刘航宇-day3/第二题/ca.java @@ -0,0 +1,14 @@ +import java.util.Scanner; + +public class ca { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + double r = 0; + r= in.nextDouble(); + double S_fang = r * r; + double S_yuan = 3.14 * (r * r)/4; + double S_ca = S_fang - S_yuan; + System.out.println("面积差是:" + S_ca); + in.close(); + } +} diff --git a/作业/作业/刘航宇-day3/第二题/屏幕截图 2025-10-30 193802.png b/作业/作业/刘航宇-day3/第二题/屏幕截图 2025-10-30 193802.png new file mode 100644 index 0000000..da481b0 Binary files /dev/null and b/作业/作业/刘航宇-day3/第二题/屏幕截图 2025-10-30 193802.png differ diff --git a/作业/作业/刘航宇-day30/第一题/image.png b/作业/作业/刘航宇-day30/第一题/image.png new file mode 100644 index 0000000..564a009 Binary files /dev/null and b/作业/作业/刘航宇-day30/第一题/image.png differ diff --git a/作业/作业/刘航宇-day30/第二题/Main.java b/作业/作业/刘航宇-day30/第二题/Main.java new file mode 100644 index 0000000..0ffa9a4 --- /dev/null +++ b/作业/作业/刘航宇-day30/第二题/Main.java @@ -0,0 +1,28 @@ +import java.util.Scanner; +import java.math.BigInteger; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int n = in.nextInt(); + BigInteger num = BigInteger.ZERO; + BigInteger den = BigInteger.ONE; + for (int i = 0; i < n; i++) { + String t = in.next(); + int idx = t.indexOf('/'); + BigInteger p = new BigInteger(t.substring(0, idx)); + BigInteger q = new BigInteger(t.substring(idx + 1)); + num = num.multiply(q).add(p.multiply(den)); + den = den.multiply(q); + BigInteger g = num.gcd(den); + num = num.divide(g); + den = den.divide(g); + } + if (den.equals(BigInteger.ONE)) { + System.out.println(num.toString()); + } else { + System.out.println(num.toString() + "/" + den.toString()); + } + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day30/第二题/image.png b/作业/作业/刘航宇-day30/第二题/image.png new file mode 100644 index 0000000..dcd132a Binary files /dev/null and b/作业/作业/刘航宇-day30/第二题/image.png differ diff --git a/作业/作业/刘航宇-day31/第一题/Main.java b/作业/作业/刘航宇-day31/第一题/Main.java new file mode 100644 index 0000000..1580f4f --- /dev/null +++ b/作业/作业/刘航宇-day31/第一题/Main.java @@ -0,0 +1,29 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + String line = in.nextLine(); + int n = line.length(); + StringBuilder cur = new StringBuilder(); + String ans = ""; + int maxLen = -1; + for (int i = 0; i < n; i++) { + char c = line.charAt(i); + if (c == ' ' || c == '.') { + if (cur.length() > 0) { + if (cur.length() > maxLen) { + maxLen = cur.length(); + ans = cur.toString(); + } + cur.setLength(0); + } + } else { + cur.append(c); + } + } + if (cur.length() > 0 && maxLen < cur.length()) ans = cur.toString(); + System.out.println(ans); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day31/第一题/image.png b/作业/作业/刘航宇-day31/第一题/image.png new file mode 100644 index 0000000..95f9d97 Binary files /dev/null and b/作业/作业/刘航宇-day31/第一题/image.png differ diff --git a/作业/作业/刘航宇-day31/第二题/Main.java b/作业/作业/刘航宇-day31/第二题/Main.java new file mode 100644 index 0000000..c59b989 --- /dev/null +++ b/作业/作业/刘航宇-day31/第二题/Main.java @@ -0,0 +1,29 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + String s = in.nextLine().trim(); + String[] p = s.split("-"); + int y = Integer.parseInt(p[0]); + int m = Integer.parseInt(p[1]); + int d = Integer.parseInt(p[2]); + int[] md = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; + boolean leap = (y % 400 == 0) || (y % 4 == 0 && y % 100 != 0); + if (leap) + md[1] = 29; + if (d < md[m - 1]) { + d++; + } else { + d = 1; + if (m < 12) + m++; + else { + m = 1; + y++; + } + } + System.out.printf("%04d-%02d-%02d\n", y, m, d); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day31/第二题/image.png b/作业/作业/刘航宇-day31/第二题/image.png new file mode 100644 index 0000000..2125a13 Binary files /dev/null and b/作业/作业/刘航宇-day31/第二题/image.png differ diff --git a/作业/作业/刘航宇-day32/第一题/Main.java b/作业/作业/刘航宇-day32/第一题/Main.java new file mode 100644 index 0000000..1580f4f --- /dev/null +++ b/作业/作业/刘航宇-day32/第一题/Main.java @@ -0,0 +1,29 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + String line = in.nextLine(); + int n = line.length(); + StringBuilder cur = new StringBuilder(); + String ans = ""; + int maxLen = -1; + for (int i = 0; i < n; i++) { + char c = line.charAt(i); + if (c == ' ' || c == '.') { + if (cur.length() > 0) { + if (cur.length() > maxLen) { + maxLen = cur.length(); + ans = cur.toString(); + } + cur.setLength(0); + } + } else { + cur.append(c); + } + } + if (cur.length() > 0 && maxLen < cur.length()) ans = cur.toString(); + System.out.println(ans); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day32/第一题/image.png b/作业/作业/刘航宇-day32/第一题/image.png new file mode 100644 index 0000000..503668e Binary files /dev/null and b/作业/作业/刘航宇-day32/第一题/image.png differ diff --git a/作业/作业/刘航宇-day33/第一题/Main.java b/作业/作业/刘航宇-day33/第一题/Main.java new file mode 100644 index 0000000..cbca7ea --- /dev/null +++ b/作业/作业/刘航宇-day33/第一题/Main.java @@ -0,0 +1,17 @@ +import java.util.Scanner; +import java.util.HashSet; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + String s = in.next(); + HashSet set = new HashSet<>(); + boolean dup = false; + for (int i = 0; i < s.length(); i++) { + char c = s.charAt(i); + if (!set.add(c)) { dup = true; break; } + } + System.out.println(dup ? 1 : 0); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day33/第一题/image.png b/作业/作业/刘航宇-day33/第一题/image.png new file mode 100644 index 0000000..3825eb8 Binary files /dev/null and b/作业/作业/刘航宇-day33/第一题/image.png differ diff --git a/作业/作业/刘航宇-day33/第三题/Main.java b/作业/作业/刘航宇-day33/第三题/Main.java new file mode 100644 index 0000000..f8a8dff --- /dev/null +++ b/作业/作业/刘航宇-day33/第三题/Main.java @@ -0,0 +1,31 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + String s = in.next(); + int n = s.length(); + int best = 1; + for (int i = 0; i < n; i++) { + int l = i, r = i; + while (l >= 0 && r < n && s.charAt(l) == s.charAt(r)) { + l--; + r++; + } + int len1 = r - l - 1; + if (len1 > best) + best = len1; + l = i; + r = i + 1; + while (l >= 0 && r < n && s.charAt(l) == s.charAt(r)) { + l--; + r++; + } + int len2 = r - l - 1; + if (len2 > best) + best = len2; + } + System.out.println(best); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day33/第三题/image.png b/作业/作业/刘航宇-day33/第三题/image.png new file mode 100644 index 0000000..ada2fa6 Binary files /dev/null and b/作业/作业/刘航宇-day33/第三题/image.png differ diff --git a/作业/作业/刘航宇-day33/第二题/Main.java b/作业/作业/刘航宇-day33/第二题/Main.java new file mode 100644 index 0000000..f915bf7 --- /dev/null +++ b/作业/作业/刘航宇-day33/第二题/Main.java @@ -0,0 +1,15 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + String s = in.next(); + long ans = 0L; + for (int i = 0; i < s.length(); i++) { + char c = Character.toUpperCase(s.charAt(i)); + ans = ans * 26 + (c - 'A' + 1); + } + System.out.println(ans); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day33/第二题/image.png b/作业/作业/刘航宇-day33/第二题/image.png new file mode 100644 index 0000000..e53f266 Binary files /dev/null and b/作业/作业/刘航宇-day33/第二题/image.png differ diff --git a/作业/作业/刘航宇-day34/第一题/Main.java b/作业/作业/刘航宇-day34/第一题/Main.java new file mode 100644 index 0000000..1c7905e --- /dev/null +++ b/作业/作业/刘航宇-day34/第一题/Main.java @@ -0,0 +1,19 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + String s = in.nextLine(); + String[] nums = in.nextLine().trim().split(" "); + int a = Integer.parseInt(nums[0]); + int b = Integer.parseInt(nums[1]); + String left = s.substring(0, a - 1); + String mid = s.substring(a - 1, b); + String right = s.substring(b); + StringBuilder sb = new StringBuilder(mid); + sb.reverse(); + String res = left + sb.toString() + right; + System.out.println(res); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day34/第一题/image.png b/作业/作业/刘航宇-day34/第一题/image.png new file mode 100644 index 0000000..a50be17 Binary files /dev/null and b/作业/作业/刘航宇-day34/第一题/image.png differ diff --git a/作业/作业/刘航宇-day34/第三题/Main.java b/作业/作业/刘航宇-day34/第三题/Main.java new file mode 100644 index 0000000..8246aa4 --- /dev/null +++ b/作业/作业/刘航宇-day34/第三题/Main.java @@ -0,0 +1,59 @@ +import java.util.Scanner; + +public class Main { + static boolean isPrime(int x) { + if (x < 2) + return false; + if (x % 2 == 0) + return x == 2; + for (int i = 3; i * i <= x; i += 2) { + if (x % i == 0) + return false; + } + return true; + } + + static boolean noZero(String s) { + for (int i = 0; i < s.length(); i++) + if (s.charAt(i) == '0') + return false; + return true; + } + + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + String s = in.next().trim(); + boolean left = false, right = false; + if (noZero(s)) { + boolean ok = true; + for (int i = 0; i < s.length(); i++) { + int v = Integer.parseInt(s.substring(i)); + if (!isPrime(v)) { + ok = false; + break; + } + } + left = ok; + } + if (noZero(s)) { + boolean ok = true; + for (int i = s.length(); i >= 1; i--) { + int v = Integer.parseInt(s.substring(0, i)); + if (!isPrime(v)) { + ok = false; + break; + } + } + right = ok; + } + if (left && right) + System.out.println("both"); + else if (left) + System.out.println("left"); + else if (right) + System.out.println("right"); + else + System.out.println("false"); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day34/第三题/image.png b/作业/作业/刘航宇-day34/第三题/image.png new file mode 100644 index 0000000..e6b0939 Binary files /dev/null and b/作业/作业/刘航宇-day34/第三题/image.png differ diff --git a/作业/作业/刘航宇-day34/第二题/Main.java b/作业/作业/刘航宇-day34/第二题/Main.java new file mode 100644 index 0000000..c02c719 --- /dev/null +++ b/作业/作业/刘航宇-day34/第二题/Main.java @@ -0,0 +1,41 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int n = in.nextInt(); + if (n <= 0) { + System.out.println(n); + in.close(); + return; + } + int[][] a = new int[n][n]; + for (int i = 0; i < n; i++) { + for (int j = 0; j < n; j++) { + a[i][j] = in.nextInt(); + } + } + StringBuilder out = new StringBuilder(); + for (int i = 0; i < n; i++) { + for (int j = 0; j < n; j++) { + int v = a[i][j]; + boolean ok = true; + if (i > 0 && a[i - 1][j] >= v) + ok = false; + if (i < n - 1 && a[i + 1][j] >= v) + ok = false; + if (j > 0 && a[i][j - 1] >= v) + ok = false; + if (j < n - 1 && a[i][j + 1] >= v) + ok = false; + if (ok) { + if (out.length() > 0) + out.append(' '); + out.append(v); + } + } + } + System.out.println(out.toString()); + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day34/第二题/image.png b/作业/作业/刘航宇-day34/第二题/image.png new file mode 100644 index 0000000..d39a4fc Binary files /dev/null and b/作业/作业/刘航宇-day34/第二题/image.png differ diff --git a/作业/作业/刘航宇-day4/第一题/NineBiao.java b/作业/作业/刘航宇-day4/第一题/NineBiao.java new file mode 100644 index 0000000..752e92e --- /dev/null +++ b/作业/作业/刘航宇-day4/第一题/NineBiao.java @@ -0,0 +1,17 @@ +import java.util.Scanner; + +public class NineBiao { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + 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(); + } + in.close(); + } + +} diff --git a/作业/作业/刘航宇-day4/第一题/屏幕截图 2025-10-30 192803.png b/作业/作业/刘航宇-day4/第一题/屏幕截图 2025-10-30 192803.png new file mode 100644 index 0000000..1b7cf31 Binary files /dev/null and b/作业/作业/刘航宇-day4/第一题/屏幕截图 2025-10-30 192803.png differ diff --git a/作业/作业/刘航宇-day4/第二题/Jiecheng.java b/作业/作业/刘航宇-day4/第二题/Jiecheng.java new file mode 100644 index 0000000..1eb9dcc --- /dev/null +++ b/作业/作业/刘航宇-day4/第二题/Jiecheng.java @@ -0,0 +1,21 @@ +import java.util.Scanner; + +public class Jiecheng { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + System.out.print("请输入n和a:"); + int n, a; + n = in.nextInt(); + a = in.nextInt(); + int Sn = 0; + int Ji = a; + for (int i = 0; i < n; i++) + { + Sn += Ji; + Ji = (Ji * 10)+a; + } + System.out.println(Sn); + in.close(); + } + +} diff --git a/作业/作业/刘航宇-day4/第二题/image.png b/作业/作业/刘航宇-day4/第二题/image.png new file mode 100644 index 0000000..da481b0 Binary files /dev/null and b/作业/作业/刘航宇-day4/第二题/image.png differ diff --git a/作业/作业/刘航宇-day5/第一题/Lingxin.java b/作业/作业/刘航宇-day5/第一题/Lingxin.java new file mode 100644 index 0000000..e773fe4 --- /dev/null +++ b/作业/作业/刘航宇-day5/第一题/Lingxin.java @@ -0,0 +1,37 @@ +import java.util.Scanner; + +public class Lingxin{ + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + System.out.print("输入菱形的边长n:"); + int n = in.nextInt(); + + for (int i = 0; i < n; i++) + { + for (int j = 0; j < n - i - 1; j++) + { + System.out.print(" "); + } + for (int k = 0; k < 2 * i + 1; k++) + { + System.out.print("*"); + } + System.out.println(); + } + + for (int i = 1; i < n; i++) + { + for (int j = 0; j < i; j++) + { + System.out.print(" "); + } + for (int k = 0; k < 2 * (n - i) - 1; k++) + { + System.out.print("*"); + } + System.out.println(); + } + + in.close(); + } +} diff --git a/作业/作业/刘航宇-day5/第一题/image.png b/作业/作业/刘航宇-day5/第一题/image.png new file mode 100644 index 0000000..ac6d2b4 Binary files /dev/null and b/作业/作业/刘航宇-day5/第一题/image.png differ diff --git a/作业/作业/刘航宇-day5/第三题/GuessNum.java b/作业/作业/刘航宇-day5/第三题/GuessNum.java new file mode 100644 index 0000000..99b0193 --- /dev/null +++ b/作业/作业/刘航宇-day5/第三题/GuessNum.java @@ -0,0 +1,34 @@ +import java.util.Scanner; + +public class GuessNum { + public static void main(String[] args) { + Scanner in= new Scanner(System.in); + System.out.print("请输入整数(1~100):"); + int num = in.nextInt(); + + if (num <= 0 || num >= 100) + { + System.out.print("请重新输入整数:"); + } + while (true) + { + System.out.print("请输入你猜测的数字(1~100):"); + int n = in.nextInt(); + if (nnum) + { + System.out.println("大"); + } + if (n==num) + { + System.out.println("正确"); + break; + } + } + + in.close(); + } +} diff --git a/作业/作业/刘航宇-day5/第三题/image.png b/作业/作业/刘航宇-day5/第三题/image.png new file mode 100644 index 0000000..869b7dc Binary files /dev/null and b/作业/作业/刘航宇-day5/第三题/image.png differ diff --git a/作业/作业/刘航宇-day5/第二题/Sushu.java b/作业/作业/刘航宇-day5/第二题/Sushu.java new file mode 100644 index 0000000..879a683 --- /dev/null +++ b/作业/作业/刘航宇-day5/第二题/Sushu.java @@ -0,0 +1,35 @@ +import java.util.Scanner; + +public class Sushu { + public boolean isPrime(int num) { + if (num <= 1) + { + return false; + } + for (int i = 2; i <= Math.sqrt(num); i++) + { + if (num % i == 0) + { + return false; + } + } + return true; + } + + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + Sushu sushu = new Sushu(); + System.out.print("请输入N:"); + int n = in.nextInt(); + int m=2; + while(m<=n) + { + if (sushu.isPrime(m)) + { + System.out.println(m); + } + m++; + } + in.close(); + } +} diff --git a/作业/作业/刘航宇-day5/第二题/image.png b/作业/作业/刘航宇-day5/第二题/image.png new file mode 100644 index 0000000..420c6cb Binary files /dev/null and b/作业/作业/刘航宇-day5/第二题/image.png differ diff --git a/作业/作业/刘航宇-day6/第一题/NumberC.java b/作业/作业/刘航宇-day6/第一题/NumberC.java new file mode 100644 index 0000000..a644e79 --- /dev/null +++ b/作业/作业/刘航宇-day6/第一题/NumberC.java @@ -0,0 +1,32 @@ +import java.util.Scanner; + +public class NumberC { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + System.out.print("请输入一个正整数的长度为n的数字环:"); + int n = in.nextInt(); + int[] Ni = new int[n]; + int count=0; + while (count < n) + { + System.out.print("请输入数字环中的" + n + "个数字(每个数字以空格隔开):"); + Ni[count] = in.nextInt(); + count++; + } + + System.out.print("请输入一个正整数m(1<=m<=n),表示每个元素需要往后移动m位:"); + int m = in.nextInt(); + int[] newNi = new int[n]; + for (int i = 0; i < n; i++) { + newNi[(i + m) % n] = Ni[i]; + } + + System.out.print("数字环移动后的结果为:"); + for (int i = 0; i < n; i++) { + System.out.print(newNi[i] + " "); + } + + in.close(); + } + +} diff --git a/作业/作业/刘航宇-day6/第一题/image.png b/作业/作业/刘航宇-day6/第一题/image.png new file mode 100644 index 0000000..71a1d61 Binary files /dev/null and b/作业/作业/刘航宇-day6/第一题/image.png differ diff --git a/作业/作业/刘航宇-day6/第三题/JosephusProblem.java b/作业/作业/刘航宇-day6/第三题/JosephusProblem.java new file mode 100644 index 0000000..5a89671 --- /dev/null +++ b/作业/作业/刘航宇-day6/第三题/JosephusProblem.java @@ -0,0 +1,28 @@ +import java.util.ArrayList; +import java.util.Scanner; + +public class JosephusProblem { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + int n = in.nextInt(); + int m = in.nextInt(); + in.close(); + + // 初始化参与者列表,编号1~n + ArrayList participants = new ArrayList<>(); + for (int i = 1; i <= n; i++) { + participants.add(i); + } + + int index = 0; // 记录当前报数的起始位置 + while (participants.size() > 1) { + // 计算要淘汰的位置 + index = (index + m - 1) % participants.size(); + // 淘汰该位置的参与者 + participants.remove(index); + } + + // 输出最后胜利者 + System.out.println(participants.get(0)); + } +} diff --git a/作业/作业/刘航宇-day6/第三题/image.png b/作业/作业/刘航宇-day6/第三题/image.png new file mode 100644 index 0000000..6a7654b Binary files /dev/null and b/作业/作业/刘航宇-day6/第三题/image.png differ diff --git a/作业/作业/刘航宇-day6/第二题/MergeSortedArrays.java b/作业/作业/刘航宇-day6/第二题/MergeSortedArrays.java new file mode 100644 index 0000000..ee0518e --- /dev/null +++ b/作业/作业/刘航宇-day6/第二题/MergeSortedArrays.java @@ -0,0 +1,71 @@ +import java.util.Scanner; + +public class MergeSortedArrays { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + + // 读取数组大小n和m + System.out.print("请输入第一个已排序数组的大小n和第二个已排序数组的大小m:"); + int n = in.nextInt(); + int m = in.nextInt(); + in.nextLine(); // 消耗换行符,避免影响后续字符串读取 + + // 读取第一个数组(先提示,再读取) + int[] Ni = new int[n]; + System.out.print("请输入第一个已排序数组的元素(以空格隔开,共" + n + "个):"); + String[] NiStr = in.nextLine().split(" "); + // 校验输入元素数量是否正确 + if (NiStr.length != n) { + System.out.println("输入的元素数量与n不匹配!"); + return; + } + for (int i = 0; i < n; i++) { + Ni[i] = Integer.parseInt(NiStr[i]); + } + + // 读取第二个数组(先提示,再读取) + int[] Mi = new int[m]; + System.out.print("请输入第二个已排序数组的元素(以空格隔开,共" + m + "个):"); + String[] MiStr = in.nextLine().split(" "); + // 校验输入元素数量是否正确 + if (MiStr.length != m) { + System.out.println("输入的元素数量与m不匹配!"); + return; + } + for (int i = 0; i < m; i++) { + Mi[i] = Integer.parseInt(MiStr[i]); + } + + // 双指针合并数组(核心逻辑不变) + int[] result = new int[n + m]; + int i = 0, j = 0, k = 0; + while (i < n && j < m) { + if (Ni[i] <= Mi[j]) { + result[k++] = Ni[i++]; + } else { + result[k++] = Mi[j++]; + } + } + // 处理剩余元素 + while (i < n) { + result[k++] = Ni[i++]; + } + while (j < m) { + result[k++] = Mi[j++]; + } + + // 输出结果(优化末尾空格) + System.out.print("合并后的数组为:"); + StringBuilder sb = new StringBuilder(); + for (int num : result) { + sb.append(num).append(" "); + } + // 移除最后一个空格(如果有元素) + if (sb.length() > 0) { + sb.deleteCharAt(sb.length() - 1); + } + System.out.println(sb); + + in.close(); + } +} diff --git a/作业/作业/刘航宇-day6/第二题/image.png b/作业/作业/刘航宇-day6/第二题/image.png new file mode 100644 index 0000000..614fcf4 Binary files /dev/null and b/作业/作业/刘航宇-day6/第二题/image.png differ diff --git a/作业/作业/刘航宇-day7/第一题/Zhuanzhi.java b/作业/作业/刘航宇-day7/第一题/Zhuanzhi.java new file mode 100644 index 0000000..6fe415e --- /dev/null +++ b/作业/作业/刘航宇-day7/第一题/Zhuanzhi.java @@ -0,0 +1,33 @@ +import java.util.Scanner; + +public class Zhuanzhi { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + System.out.print("请输入转置矩阵的边长:"); + int n = in.nextInt(); + int[][] jvzhen = new int[n][n]; + System.out.println("请输入矩阵元素:"); + for (int i = 0; i < n; i++) { + for (int j = 0; j < n; j++) { + jvzhen[i][j] = in.nextInt(); + } + } + + int[][] newjvzhen = new int[n][n]; + for (int i = 0; i < n; i++) { + for (int j = 0; j < n; j++) { + newjvzhen[j][i] = jvzhen[i][j]; + } + } + + System.out.println("转置后的矩阵为:"); + for (int i = 0; i < n; i++) { + for (int j = 0; j < n; j++) { + System.out.print(newjvzhen[i][j] + " "); + } + System.out.println(); + } + + in.close(); + } +} diff --git a/作业/作业/刘航宇-day7/第一题/image.png b/作业/作业/刘航宇-day7/第一题/image.png new file mode 100644 index 0000000..7c1e315 Binary files /dev/null and b/作业/作业/刘航宇-day7/第一题/image.png differ diff --git a/作业/作业/刘航宇-day7/第三题/Quchong.java b/作业/作业/刘航宇-day7/第三题/Quchong.java new file mode 100644 index 0000000..01749c9 --- /dev/null +++ b/作业/作业/刘航宇-day7/第三题/Quchong.java @@ -0,0 +1,35 @@ +import java.util.Scanner; + +public class Quchong { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + System.out.print("请输入整数个数:"); + int n = in.nextInt(); + + System.out.print("请输入一串整数(用空格分隔):"); + int[] a = new int[n]; + for (int i = 0; i < n; i++) { + a[i] = in.nextInt(); + } + + // 去重逻辑修正 + for (int i = 0; i < n - 1; i++) { + for (int j = i + 1; j < n; j++) { + if (a[i] == a[j]) { + for (int k = j; k < n - 1; k++) { + a[k] = a[k + 1]; + } + n--; + j--; + } + } + } + + System.out.println("去重后的整数序列为:"); + for (int i = 0; i < n; i++) { + System.out.print(a[i] + " "); + } + + in.close(); + } +} diff --git a/作业/作业/刘航宇-day7/第三题/image.png b/作业/作业/刘航宇-day7/第三题/image.png new file mode 100644 index 0000000..6b707a8 Binary files /dev/null and b/作业/作业/刘航宇-day7/第三题/image.png differ diff --git a/作业/作业/刘航宇-day7/第二题/Xuanzhuan.java b/作业/作业/刘航宇-day7/第二题/Xuanzhuan.java new file mode 100644 index 0000000..c32ce3d --- /dev/null +++ b/作业/作业/刘航宇-day7/第二题/Xuanzhuan.java @@ -0,0 +1,33 @@ +import java.util.Scanner; + +public class Xuanzhuan { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + System.out.print("请输入旋转矩阵的边长:"); + int n = in.nextInt(); + int[][] xuanzhuan = new int[n][n]; + System.out.println("请输入矩阵元素:"); + for (int i = 0; i < n; i++) { + for (int j = 0; j < n; j++) { + xuanzhuan[i][j] = in.nextInt(); + } + } + + int[][] newxuanzhuan = new int[n][n]; + for (int i = 0; i < n; i++) { + for (int j = 0; j < n; j++) { + newxuanzhuan[j][n - 1 - i] = xuanzhuan[i][j]; + } + } + + System.out.println("旋转后的矩阵为:"); + for (int i = 0; i < n; i++) { + for (int j = 0; j < n; j++) { + System.out.print(newxuanzhuan[i][j] + " "); + } + System.out.println(); + } + + in.close(); + } +} diff --git a/作业/作业/刘航宇-day7/第二题/image.png b/作业/作业/刘航宇-day7/第二题/image.png new file mode 100644 index 0000000..3d45b25 Binary files /dev/null and b/作业/作业/刘航宇-day7/第二题/image.png differ diff --git a/作业/作业/刘航宇-day8/第一题/ZhuanHuan.java b/作业/作业/刘航宇-day8/第一题/ZhuanHuan.java new file mode 100644 index 0000000..d0faef9 --- /dev/null +++ b/作业/作业/刘航宇-day8/第一题/ZhuanHuan.java @@ -0,0 +1,34 @@ +import java.util.Scanner; + +public class ZhuanHuan +{ + public static String Zhuan(String str) { + if (str == null) + return null; + + char[] chars = str.toCharArray(); + for (int i = 0; i < chars.length; i++) { + char ch = chars[i]; + if (ch >= 'A' && ch <= 'Z') + { + chars[i] = (char) (ch + 32); // 大写转小写 + } + else if (ch >= 'a' && ch <= 'z') + { + chars[i] = (char) (ch - 32); // 小写转大写 + } + } + return new String(chars); + } + + public static void main(String[] args) + { + Scanner in = new Scanner(System.in); + System.out.print("请输入一个字符串:"); + String input = in.nextLine(); + String output = Zhuan(input); + System.out.println("转换后的字符串为:" + output); + + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day8/第一题/image.png b/作业/作业/刘航宇-day8/第一题/image.png new file mode 100644 index 0000000..7820f47 Binary files /dev/null and b/作业/作业/刘航宇-day8/第一题/image.png differ diff --git a/作业/作业/刘航宇-day8/第二题/Mima.java b/作业/作业/刘航宇-day8/第二题/Mima.java new file mode 100644 index 0000000..0cf272b --- /dev/null +++ b/作业/作业/刘航宇-day8/第二题/Mima.java @@ -0,0 +1,49 @@ +import java.util.Scanner; + +public class Mima { + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + + System.out.print("请输入密码: "); + String password = scanner.nextLine(); + + boolean isSafe = check(password); + System.out.println(isSafe); + + scanner.close(); + } + + public static boolean check(String password) { + // 条件1: 检查长度 (8-16个字符) + if (password.length() < 8 || password.length() > 16) { + return false; + } + + // 条件2: 检查首字母是否大写 + if (!Character.isUpperCase(password.charAt(0))) { + return false; + } + + // 初始化标志变量 + boolean hasLowerCase = false; + boolean hasDigit = false; + boolean hasSpecialChar = false; + String specialChars = "~!@#$%*"; + + // 遍历密码检查其他条件 + for (int i = 0; i < password.length(); i++) { + char ch = password.charAt(i); + + if (Character.isLowerCase(ch)) { + hasLowerCase = true; + } else if (Character.isDigit(ch)) { + hasDigit = true; + } else if (specialChars.indexOf(ch) != -1) { + hasSpecialChar = true; + } + } + + // 所有条件必须同时满足 + return hasLowerCase && hasDigit && hasSpecialChar; + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day8/第二题/image.png b/作业/作业/刘航宇-day8/第二题/image.png new file mode 100644 index 0000000..4b187ef Binary files /dev/null and b/作业/作业/刘航宇-day8/第二题/image.png differ diff --git a/作业/作业/刘航宇-day9/第一题/EncryptPassword.java b/作业/作业/刘航宇-day9/第一题/EncryptPassword.java new file mode 100644 index 0000000..a11398a --- /dev/null +++ b/作业/作业/刘航宇-day9/第一题/EncryptPassword.java @@ -0,0 +1,34 @@ +import java.util.Scanner; + +public class EncryptPassword { + // 对字母和数字进行 +5 的循环位移,加密其它符号保持不变 + private static char shiftChar(char ch) { + if (ch >= 'A' && ch <= 'Z') { + return (char) ('A' + (ch - 'A' + 5) % 26); + } else if (ch >= 'a' && ch <= 'z') { + return (char) ('a' + (ch - 'a' + 5) % 26); + } else if (ch >= '0' && ch <= '9') { + return (char) ('0' + (ch - '0' + 5) % 10); + } + return ch; // 其它符号不变 + } + + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + String input = in.nextLine(); + + // 题目要求长度 <= 16 + if (input.length() > 16) { + input = input.substring(0, 16); + } + + // 对输入的每个字符进行加密 + StringBuilder sb = new StringBuilder(input.length()); + for (int i = 0; i < input.length(); i++) { + sb.append(shiftChar(input.charAt(i))); + } + System.out.println(sb.toString()); + + in.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day9/第一题/image.png b/作业/作业/刘航宇-day9/第一题/image.png new file mode 100644 index 0000000..f7e9673 Binary files /dev/null and b/作业/作业/刘航宇-day9/第一题/image.png differ diff --git a/作业/作业/刘航宇-day9/第二题/ZiFu.java b/作业/作业/刘航宇-day9/第二题/ZiFu.java new file mode 100644 index 0000000..382b2fa --- /dev/null +++ b/作业/作业/刘航宇-day9/第二题/ZiFu.java @@ -0,0 +1,20 @@ +import java.util.Scanner; + +public class ZiFu { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + // 输入三行:原文 S、子串 A、子串 B + String S = sc.nextLine(); + String A = sc.nextLine(); + String B = sc.nextLine(); + // A 为空则不作替换 + if (A.length() == 0) { + System.out.println(S); + } else { + // 使用字符串的字面替换(非正则),满足题意的“用 B 替换 S 中的 A” + String result = S.replace(A, B); + System.out.println(result); + } + sc.close(); + } +} \ No newline at end of file diff --git a/作业/作业/刘航宇-day9/第二题/image.png b/作业/作业/刘航宇-day9/第二题/image.png new file mode 100644 index 0000000..6b22279 Binary files /dev/null and b/作业/作业/刘航宇-day9/第二题/image.png differ diff --git a/作业/作业/刘航宇-考核题/考核题1.java b/作业/作业/刘航宇-考核题/考核题1.java new file mode 100644 index 0000000..214134a --- /dev/null +++ b/作业/作业/刘航宇-考核题/考核题1.java @@ -0,0 +1,183 @@ +import java.util.Arrays; + + +public class CeShiOne { + /* + * 功能: 计算两个整数的最大公约数 参数: a: 第一个整数 b: 第二个整数 返回值: 两个整数的最大公约数 + */ + public static int gcd(int a, int b) { + // 在这里写函数实现 + while (b != 0) { + int r = a % b; + a = b; + b = r; + } + return a; + } + + /* + * 功能: 计算斐波那契数列的第k个数 参数: k: 在斐波那契数列中的位置(从1开始), k的值不大于40 返回值: 斐波那契数列的第k个数的值 + */ + public static int fibonacci(int k) { + // 在这里写函数实现 + if (k <= 0 || k > 40) { + return -1; + } + if (k == 1 || k == 2) { + return 1; + } + int a = 1, b = 1, fib = 0; + for (int i = 3; i <= k; i++) { + fib = a + b; + a = b; + b = fib; + } + return fib; + } + + /* + * 功能: 查找数组中第k大的元素 参数: arr: 整数数组的大小 size: 数组的大小 k: 需要查找的位置(从1开始) 返回值: 数组中第k大的元素 + */ + public static int getKthLargest(int arr[], int size, int k) { + // 在这里写函数实现 + if (k <= 0 || k > size) { + return -1; + } + // 双轴快速排序 + java.util.Arrays.sort(arr); + return arr[size - k]; + } + + /* + * 功能: 登录验证 检查输入的账号和密码是否与存储的数据匹配 参数: accounts: 存储的账号数组 passwords: 存储的密码数组(与账号对应) size: 传入数组的长度 + * inputAccount: 用户输入的账号 inputPassword: 用户输入的密码 返回值: 1: 登录成功 0: 登录失败 + */ + public static int login(int accounts[], int passwords[], int size, int inputAccount, + int inputPassword) { + // 在这里写函数实现 + for (int i = 0; i < size; i++) { + if (accounts[i] == inputAccount && passwords[i] == inputPassword) { + return 1; // 登录成功 + } else if (accounts[i] == inputAccount && passwords[i] != inputPassword) { + return 0; // 密码错误 + } + } + return 0; // 账号不存在 + } + + /* + * 功能: 日期验证 传入年,月,日三个整数参数,判断这个日期是否合法. 注意处理闰年的天数问题. 闰年判断规则: 1. 年份是4的倍数 -> 是闰年 2. 但是,年份是100的倍数 -> + * 不是闰年 3. 但是,年份是400的倍数 -> 是闰年 参数: year: 年 month: 月 day: 日 返回值: 0: 日期错误 1: 日期正确 + */ + public static int isValidDate(int year, int month, int day) { + // 是否合法 + if (year < 1 || month < 1 || month > 12 || day < 1) { + return 0; + } + + + int[] daysInMonth = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; + + // 符合以下条件之一即为闰年 + boolean isLeapYear = (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0); + + // 闰年时调整2月天数 + if (isLeapYear) { + daysInMonth[1] = 29; // 2月对应数组索引1 + } + + if (day > daysInMonth[month - 1]) { // 月份-1以匹配数组索引 + return 0; + } + + return 1; + } + + // 测试代码 + public static void main(String[] args) { + System.out.println("测试gcd函数:"); + int[][] gcdTestCases = {{48, 18, 6}, {7, 13, 1}, {0, 5, 5}, // 边界情况:一个数字为零 + {12, 12, 12}, // 边界情况:相同数字 + {1071, 462, 21}, // 更大数字:1071和462 + {270, 192, 6} // 附加测试用例 + }; + + for (int i = 0; i < gcdTestCases.length; i++) { + int result = gcd(gcdTestCases[i][0], gcdTestCases[i][1]); + System.out.printf("gcd(%d, %d) = %d [%s]\n", gcdTestCases[i][0], gcdTestCases[i][1], + result, result == gcdTestCases[i][2] ? "通过" : "失败"); + } + System.out.println(); + + System.out.println("测试fibonacci函数:"); + int[][] fibTestCases = {{1, 1}, {2, 1}, {5, 5}, {10, 55}, // 第10个斐波那契数 + {15, 610}, // 第15个斐波那契数 + {20, 6765} // 第20个斐波那契数 + }; + + for (int i = 0; i < fibTestCases.length; i++) { + int result = fibonacci(fibTestCases[i][0]); + System.out.printf("fibonacci(%d) = %d [%s]\n", fibTestCases[i][0], result, + result == fibTestCases[i][1] ? "通过" : "失败"); + } + System.out.println(); + + System.out.println("测试getKthLargest函数:"); + int[] arr1 = {4, 2, 7, 1, 3, 9, 5, 8, 6}; + int size1 = arr1.length; + + int[][] kthTestCases = {{1, 9}, // 第1大 + {2, 8}, // 第2大 + {5, 5}, // 第5大 + {9, 1} // 第9大(最小) + }; + + for (int i = 0; i < kthTestCases.length; i++) { + int result = getKthLargest(arr1, size1, kthTestCases[i][0]); + System.out.printf("getKthLargest(arr1, %d, %d) = %d [%s]\n", size1, kthTestCases[i][0], + result, result == kthTestCases[i][1] ? "通过" : "失败"); + } + System.out.println(); + + System.out.println("测试login函数:"); + int[] accounts = {1001, 1002, 1003, 1004, 0, 0, 0, 0, 0, 0}; + int[] passwords = {1234, 5678, 9012, 3456, 0, 0, 0, 0, 0, 0}; + + int[][] loginTestCases = {{1001, 1234, 1}, // 正确 + {1002, 5678, 1}, // 正确 + {1001, 9999, 0}, // 错误密码 + {9999, 1234, 0}, // 不存在的账号 + {1003, 9012, 1}, // 正确 + {1004, 0000, 0} // 错误密码 + }; + + for (int i = 0; i < loginTestCases.length; i++) { + int result = login(accounts, passwords, 10, loginTestCases[i][0], loginTestCases[i][1]); + System.out.printf("login(%d, %d) = %d [%s]\n", loginTestCases[i][0], + loginTestCases[i][1], result, result == loginTestCases[i][2] ? "通过" : "失败"); + } + System.out.println(); + + System.out.println("测试isValidDate函数:"); + int[][] dateTestCases = {{2023, 2, 28, 1}, // 有效日期:平年2月28日 + {2020, 2, 29, 1}, // 有效日期:闰年2月29日 + {2000, 2, 29, 1}, // 有效日期:世纪闰年2月29日 + {2023, 2, 29, 0}, // 无效日期:平年2月29日 + {2023, 4, 31, 0}, // 无效日期:4月31日 + {2023, 13, 1, 0}, // 无效日期:13月 + {0, 1, 1, 0}, // 无效日期:0年 + {2023, 0, 1, 0}, // 无效日期:0月 + {2023, 1, 0, 0}, // 无效日期:0日 + {2023, 12, 31, 1}, // 有效日期:12月31日 + {2023, 11, 30, 1}, // 有效日期:11月30日 + {2023, 10, 31, 1} // 有效日期:10月31日 + }; + + for (int i = 0; i < dateTestCases.length; i++) { + int result = isValidDate(dateTestCases[i][0], dateTestCases[i][1], dateTestCases[i][2]); + System.out.printf("isValidDate(%d, %d, %d) = %d [%s]\n", dateTestCases[i][0], + dateTestCases[i][1], dateTestCases[i][2], result, + result == dateTestCases[i][3] ? "通过" : "失败"); + } + } +} diff --git a/作业/作业/刘航宇-考核题/考核题1运行界面.png b/作业/作业/刘航宇-考核题/考核题1运行界面.png new file mode 100644 index 0000000..22ca199 Binary files /dev/null and b/作业/作业/刘航宇-考核题/考核题1运行界面.png differ diff --git a/作业/作业/刘航宇-考核题/考核题2.java b/作业/作业/刘航宇-考核题/考核题2.java new file mode 100644 index 0000000..9cd6396 --- /dev/null +++ b/作业/作业/刘航宇-考核题/考核题2.java @@ -0,0 +1,197 @@ +import java.util.Scanner; + +// Java: +public class Demo { + + public static Scanner scan = new Scanner(System.in); + + public static void main(String[] args) { + menuView(); + } + + + // -------------------- 数据设计 -------------------- + /* + * 棋盘: board[i][j]表示坐标(i,j)的值 0表示空地 1表示黑子 2表示白子 如: board[3][6] = 1 表示(3,6)的位置是黑子 + */ + public static int board[][] = new int[19][19]; + + // 表示当前回合数 偶数表示黑棋落子 奇数表示白棋落子 + // 如: flag = 20 表示当前是第[20]次落子 由黑方落子 + public static int flag; + // -------------------- 数据设计 -------------------- + + + // -------------------- service -------------------- + /* + * 负责人: 张三 功能: 初始化游戏数据 将棋盘的值初始化为0 当前回合设为黑棋(flag设为0) 参数: void 返回值: void + */ + public static void init() { + // 在此处完成代码 + // 初始化棋盘为0 + for (int i = 0; i < board.length; i++) { + for (int j = 0; j < board[0].length; j++) { + board[i][j] = 0; + } + } + // 初始化当前回合数为0 + flag = 0; + } + + /* + * 难点1 负责人: 张三 功能: 根据传入的坐标(board对应位置)和flag值 判断落点后是否获胜 参数: x: 当前回合落子的x坐标 y: 当前回合落子的y坐标 返回值: + * 0表示没有获胜 1表示黑子胜利 2表示白子胜利 + */ + public static int isWin(int x, int y) { + // 在此处完成代码 + + return 0; + } + + /* + * 负责人: 张三 功能: 在指定位置落子 如果board[x][y]是空地 则修改board[x][y]的值:改为相应颜色(flag对应颜色) 否则不操作 参数: x: + * 当前回合落子的x坐标 y: 当前回合落子的y坐标 返回值: 0表示落子失败 (棋盘已经有子) 1表示落子成功 + * + */ + public static int playerMove(int x, int y) { + // 在此处完成代码 + // 检查坐标是否超出棋盘范围 + if (x < 0 || x >= board.length || y < 0 || y >= board[0].length) { + System.out.println("坐标超出棋盘范围"); + return 0; + } + + // 检查坐标是否已经有落子 + if (board[x][y] != 0) { + System.out.println("该位置已经有落子"); + return 0; + } + + // 落子 + board[x][y] = flag % 2 + 1; + return 1; + } + // -------------------- service -------------------- + + + + // -------------------- view -------------------- + /* + * 功能: 展示选项, 玩家可以在这里选择进入游戏, 进入设置或退出游戏 while(1){ 1. 展示选项 2. 用户输入 3. 根据输入进行对应处理 进入游戏: + * 调用游戏界面函数gameView(); 进入设置: 打印敬请期待... 重新循环 退出游戏: 调用exit(0); } + */ + public static void menuView() { + // 在此处完成代码 + while (true) { + System.out.println("1. 进入游戏"); + System.out.println("2. 进入设置"); + System.out.println("3. 退出游戏"); + System.out.print("请输入您的选择: "); + int choice = scan.nextInt(); + switch (choice) { + case 1: + gameView(); + break; + case 2: + System.out.println("敬请期待..."); + break; + case 3: + System.out.println("退出游戏"); + System.exit(0); + break; + default: + System.out.println("无效选择"); + } + } + } + + /* + * 负责人: 张三 功能: 根据board数组 打印游戏棋盘 参数: void 返回值: void + */ + public static void gameView_ShowBoard() { + // 在此处完成代码 + // 打印列号(1-board.length显示) + System.out.print("\n "); + for (int i = 0; i < board.length; i++) { + System.out.printf("%2d", i + 1); + if (i + 1 == 9) { + // 处理列号9和10+的对齐 + System.out.print(" "); + } + } + System.out.println(); + + // 逐行打印棋盘内容 + int player = flag % 2 + 1; + for (int i = 0; i < board.length; i++) { + // 打印行号(1-board.length) + System.out.printf("%2d ", i + 1); + for (int j = 0; j < board.length; j++) { + if (board[i][j] == player) { + // 黑棋子 + System.out.print("x "); + } else if (board[i][j] == (player) % 2 + 1) { + // 白棋子 + System.out.print("○ "); + } else { + // 空位 + System.out.print("· "); + } + } + System.out.println(); // 每行结束换行 + } + } + + /* + * 负责人: 张三 功能: 根据flag的值 打印游戏胜利界面 用户可以按回车键回到主菜单 参数: void 返回值: void + */ + public static void winView() { + // 在此处完成代码 + // 打印游戏胜利界面 + if (flag % 2 == 0) { + System.out.println("黑棋胜利"); + } else { + System.out.println("白棋胜利"); + } + // 等待用户按回车键返回主菜单 + System.out.println("按回车键返回主菜单"); + scan.nextLine(); + scan.nextLine(); + } + + /* + * 难点2 负责人: 张三 功能: 游戏界面整合 初始化游戏数据(调用函数init()) while(1){ 打印游戏界面(调用函数gameView_ShowBoard()) + * 接收玩家坐标输入 + * + * 落子(调用落子函数playerMove()) (如果落子失败 重新开始循环) + * + * 判断游戏是否胜利(调用胜利判断函数isWin()) (如果游戏胜利 调用胜利界面函数 然后结束当前界面) 切换玩家(修改flag值) } 参数: void 返回值: void + */ + public static void gameView() { + // 在此处完成代码 + // 初始化游戏数据 + init(); + // 游戏主循环 + while (true) { + // 打印游戏界面 + gameView_ShowBoard(); + // 接收玩家坐标输入 + System.out.print("请输入您的落子坐标 (x y): "); + int x = scan.nextInt() - 1; + int y = scan.nextInt() - 1; + // 落子 + if (playerMove(x, y) == 0) { + continue; + } + // 判断游戏是否胜利 + int win = isWin(x, y); + if (win != 0) { + winView(); + break; + } + // 切换玩家 + flag++; + } + } + // -------------------- view -------------------- +} \ No newline at end of file diff --git a/作业/压缩包/刘航宇-day1.zip b/作业/压缩包/刘航宇-day1.zip new file mode 100644 index 0000000..7dae520 Binary files /dev/null and b/作业/压缩包/刘航宇-day1.zip differ diff --git a/作业/压缩包/刘航宇-day10.zip b/作业/压缩包/刘航宇-day10.zip new file mode 100644 index 0000000..e79544e Binary files /dev/null and b/作业/压缩包/刘航宇-day10.zip differ diff --git a/作业/压缩包/刘航宇-day11.zip b/作业/压缩包/刘航宇-day11.zip new file mode 100644 index 0000000..bc5558a Binary files /dev/null and b/作业/压缩包/刘航宇-day11.zip differ diff --git a/作业/压缩包/刘航宇-day12.zip b/作业/压缩包/刘航宇-day12.zip new file mode 100644 index 0000000..849c4c5 Binary files /dev/null and b/作业/压缩包/刘航宇-day12.zip differ diff --git a/作业/压缩包/刘航宇-day13.zip b/作业/压缩包/刘航宇-day13.zip new file mode 100644 index 0000000..d9e78d9 Binary files /dev/null and b/作业/压缩包/刘航宇-day13.zip differ diff --git a/作业/压缩包/刘航宇-day14.zip b/作业/压缩包/刘航宇-day14.zip new file mode 100644 index 0000000..83f1499 Binary files /dev/null and b/作业/压缩包/刘航宇-day14.zip differ diff --git a/作业/压缩包/刘航宇-day15.zip b/作业/压缩包/刘航宇-day15.zip new file mode 100644 index 0000000..1f785cc Binary files /dev/null and b/作业/压缩包/刘航宇-day15.zip differ diff --git a/作业/压缩包/刘航宇-day16.zip b/作业/压缩包/刘航宇-day16.zip new file mode 100644 index 0000000..65c355b Binary files /dev/null and b/作业/压缩包/刘航宇-day16.zip differ diff --git a/作业/压缩包/刘航宇-day17.zip b/作业/压缩包/刘航宇-day17.zip new file mode 100644 index 0000000..84643cd Binary files /dev/null and b/作业/压缩包/刘航宇-day17.zip differ diff --git a/作业/压缩包/刘航宇-day18.zip b/作业/压缩包/刘航宇-day18.zip new file mode 100644 index 0000000..08ce3d1 Binary files /dev/null and b/作业/压缩包/刘航宇-day18.zip differ diff --git a/作业/压缩包/刘航宇-day19.zip b/作业/压缩包/刘航宇-day19.zip new file mode 100644 index 0000000..3226d78 Binary files /dev/null and b/作业/压缩包/刘航宇-day19.zip differ diff --git a/作业/压缩包/刘航宇-day2.zip b/作业/压缩包/刘航宇-day2.zip new file mode 100644 index 0000000..db2355f Binary files /dev/null and b/作业/压缩包/刘航宇-day2.zip differ diff --git a/作业/压缩包/刘航宇-day20.zip b/作业/压缩包/刘航宇-day20.zip new file mode 100644 index 0000000..87f91dc Binary files /dev/null and b/作业/压缩包/刘航宇-day20.zip differ diff --git a/作业/压缩包/刘航宇-day21.zip b/作业/压缩包/刘航宇-day21.zip new file mode 100644 index 0000000..5d3dab4 Binary files /dev/null and b/作业/压缩包/刘航宇-day21.zip differ diff --git a/作业/压缩包/刘航宇-day22.zip b/作业/压缩包/刘航宇-day22.zip new file mode 100644 index 0000000..e8639b2 Binary files /dev/null and b/作业/压缩包/刘航宇-day22.zip differ diff --git a/作业/压缩包/刘航宇-day23.zip b/作业/压缩包/刘航宇-day23.zip new file mode 100644 index 0000000..e2a6c8f Binary files /dev/null and b/作业/压缩包/刘航宇-day23.zip differ diff --git a/作业/压缩包/刘航宇-day24.zip b/作业/压缩包/刘航宇-day24.zip new file mode 100644 index 0000000..f45a5f6 Binary files /dev/null and b/作业/压缩包/刘航宇-day24.zip differ diff --git a/作业/压缩包/刘航宇-day25.zip b/作业/压缩包/刘航宇-day25.zip new file mode 100644 index 0000000..bbb8cb1 Binary files /dev/null and b/作业/压缩包/刘航宇-day25.zip differ diff --git a/作业/压缩包/刘航宇-day26.zip b/作业/压缩包/刘航宇-day26.zip new file mode 100644 index 0000000..6ce164b Binary files /dev/null and b/作业/压缩包/刘航宇-day26.zip differ diff --git a/作业/压缩包/刘航宇-day27.zip b/作业/压缩包/刘航宇-day27.zip new file mode 100644 index 0000000..006051f Binary files /dev/null and b/作业/压缩包/刘航宇-day27.zip differ diff --git a/作业/压缩包/刘航宇-day28.zip b/作业/压缩包/刘航宇-day28.zip new file mode 100644 index 0000000..6698587 Binary files /dev/null and b/作业/压缩包/刘航宇-day28.zip differ diff --git a/作业/压缩包/刘航宇-day29.zip b/作业/压缩包/刘航宇-day29.zip new file mode 100644 index 0000000..2db1219 Binary files /dev/null and b/作业/压缩包/刘航宇-day29.zip differ diff --git a/作业/压缩包/刘航宇-day3.zip b/作业/压缩包/刘航宇-day3.zip new file mode 100644 index 0000000..2b4dde2 Binary files /dev/null and b/作业/压缩包/刘航宇-day3.zip differ diff --git a/作业/压缩包/刘航宇-day30.zip b/作业/压缩包/刘航宇-day30.zip new file mode 100644 index 0000000..3adfc0e Binary files /dev/null and b/作业/压缩包/刘航宇-day30.zip differ diff --git a/作业/压缩包/刘航宇-day31.zip b/作业/压缩包/刘航宇-day31.zip new file mode 100644 index 0000000..37bba93 Binary files /dev/null and b/作业/压缩包/刘航宇-day31.zip differ diff --git a/作业/压缩包/刘航宇-day32.zip b/作业/压缩包/刘航宇-day32.zip new file mode 100644 index 0000000..4ea8723 Binary files /dev/null and b/作业/压缩包/刘航宇-day32.zip differ diff --git a/作业/压缩包/刘航宇-day33.zip b/作业/压缩包/刘航宇-day33.zip new file mode 100644 index 0000000..f86d29c Binary files /dev/null and b/作业/压缩包/刘航宇-day33.zip differ diff --git a/作业/压缩包/刘航宇-day34.zip b/作业/压缩包/刘航宇-day34.zip new file mode 100644 index 0000000..92122c2 Binary files /dev/null and b/作业/压缩包/刘航宇-day34.zip differ diff --git a/作业/压缩包/刘航宇-day4.zip b/作业/压缩包/刘航宇-day4.zip new file mode 100644 index 0000000..0a64bb4 Binary files /dev/null and b/作业/压缩包/刘航宇-day4.zip differ diff --git a/作业/压缩包/刘航宇-day5.zip b/作业/压缩包/刘航宇-day5.zip new file mode 100644 index 0000000..a541006 Binary files /dev/null and b/作业/压缩包/刘航宇-day5.zip differ diff --git a/作业/压缩包/刘航宇-day6.zip b/作业/压缩包/刘航宇-day6.zip new file mode 100644 index 0000000..2822009 Binary files /dev/null and b/作业/压缩包/刘航宇-day6.zip differ diff --git a/作业/压缩包/刘航宇-day7.zip b/作业/压缩包/刘航宇-day7.zip new file mode 100644 index 0000000..1e8a065 Binary files /dev/null and b/作业/压缩包/刘航宇-day7.zip differ diff --git a/作业/压缩包/刘航宇-day8.zip b/作业/压缩包/刘航宇-day8.zip new file mode 100644 index 0000000..45cd342 Binary files /dev/null and b/作业/压缩包/刘航宇-day8.zip differ diff --git a/作业/压缩包/刘航宇-day9.zip b/作业/压缩包/刘航宇-day9.zip new file mode 100644 index 0000000..efbbd75 Binary files /dev/null and b/作业/压缩包/刘航宇-day9.zip differ