From 9b6837aad573b23f745f36f14f5bc7f3444abd31 Mon Sep 17 00:00:00 2001 From: lzy <3479370893@qq.com> Date: Fri, 26 Sep 2025 21:44:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96JavaS=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=BA=86=E4=B8=80=E4=BA=9B=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/README.md | 3 ++- src/com/mathpaper/main/Main.java | 9 ++++----- src/com/mathpaper/question/PrimaryQuestionGenerator.java | 1 - src/com/mathpaper/question/QuestionChecker.java | 1 - src/com/mathpaper/question/SeniorQuestionGenerator.java | 1 - src/com/mathpaper/util/Utils.java | 6 +++--- 6 files changed, 9 insertions(+), 12 deletions(-) diff --git a/doc/README.md b/doc/README.md index e9e261d..3cc62b1 100644 --- a/doc/README.md +++ b/doc/README.md @@ -30,4 +30,5 @@ ## 4. 注意事项 - 题目数量仅支持10-30,输入其他数字(除-1外)会退出登录。 - 生成的题目保存在项目根目录`generated_papers`下的用户文件夹中。 -- 切换学段时需严格按照“切换为小学/初中/高中”格式输入,否则提示无效。 \ No newline at end of file +- 切换学段时需严格按照“切换为小学/初中/高中”格式输入,否则提示无效。 +- jdk版本为19。 \ No newline at end of file diff --git a/src/com/mathpaper/main/Main.java b/src/com/mathpaper/main/Main.java index 3d5d091..1972816 100644 --- a/src/com/mathpaper/main/Main.java +++ b/src/com/mathpaper/main/Main.java @@ -17,11 +17,11 @@ public class Main { public static void main(String[] args) { System.out.println("=== 中小学数学卷子自动生成程序 ==="); while (true) { - // 1. 登录流程(完全不变) + // 1. 登录流程 String username = login(); if (username == null) continue; - // 2. 登录后操作:初始学段为账号对应的学段(完全不变) + // 2. 登录后操作:初始学段为账号对应的学段 String currentType = AccountManager.getAccountType(username); while (true) { // 提示信息:始终使用当前有效的 currentType(无效切换后不变) @@ -35,7 +35,7 @@ public class Main { continue; } - // 处理题目数量输入(完全不变) + // 处理题目数量输入 int count = parseCount(input); if (count == -1) { System.out.println("退出当前用户,返回登录界面..."); @@ -79,8 +79,7 @@ public class Main { } /** - * 关键修改:新增 currentType 参数,无效输入时返回原学段(保持修改前) - * 其他逻辑(提示文字、有效学段判断)完全不变 + * 新增 currentType 参数,无效输入时返回原学段 */ private static String handleTypeSwitch(String input, String currentType) { String targetType = input.substring(3).trim(); diff --git a/src/com/mathpaper/question/PrimaryQuestionGenerator.java b/src/com/mathpaper/question/PrimaryQuestionGenerator.java index cdfe5a7..340a20c 100644 --- a/src/com/mathpaper/question/PrimaryQuestionGenerator.java +++ b/src/com/mathpaper/question/PrimaryQuestionGenerator.java @@ -1,4 +1,3 @@ -// 修改后的PrimaryQuestionGenerator.java package com.mathpaper.question; import com.mathpaper.util.Utils; diff --git a/src/com/mathpaper/question/QuestionChecker.java b/src/com/mathpaper/question/QuestionChecker.java index 161b866..ba04293 100644 --- a/src/com/mathpaper/question/QuestionChecker.java +++ b/src/com/mathpaper/question/QuestionChecker.java @@ -1,4 +1,3 @@ -// mathpaper/question/QuestionChecker.java package com.mathpaper.question; import com.mathpaper.file.FileHandler; diff --git a/src/com/mathpaper/question/SeniorQuestionGenerator.java b/src/com/mathpaper/question/SeniorQuestionGenerator.java index b16b375..1fe8f23 100644 --- a/src/com/mathpaper/question/SeniorQuestionGenerator.java +++ b/src/com/mathpaper/question/SeniorQuestionGenerator.java @@ -1,4 +1,3 @@ -// 修改后的SeniorQuestionGenerator.java package com.mathpaper.question; import com.mathpaper.util.Utils; diff --git a/src/com/mathpaper/util/Utils.java b/src/com/mathpaper/util/Utils.java index eed6bf8..ccc016f 100644 --- a/src/com/mathpaper/util/Utils.java +++ b/src/com/mathpaper/util/Utils.java @@ -29,13 +29,13 @@ public class Utils { // 生成三角函数 public static String getTrigFunc() { String func = TRIG_FUNCS[RANDOM.nextInt(TRIG_FUNCS.length)]; - int angle = RANDOM.nextInt(181); - return func + "(" + angle + ")°"; + int angle = RANDOM.nextInt(101); + return func + "(" + angle + ")"; } // 生成平方 public static String getSquare(String num) { - return num + "\u00B2"; + return num + "²"; } // 生成开根号