123 #1

Merged
hnu202306060209 merged 4 commits from develop into main 4 months ago

@ -0,0 +1,2 @@
# math_paper

@ -1 +0,0 @@
Authenticator.java

@ -1,43 +0,0 @@
import java.util.Random;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
abstract public class AbstractQuestionGenerator {
protected final Random random = new Random();
protected final Level level;
public AbstractQuestionGenerator(Level level) {
this.level = level;
}
protected int getRandomNumber() {
return random.nextInt(100) + 1;
}
protected String getRandomBinaryOp() {
String[] ops = {"+", "-", "*", "/"};
return ops[random.nextInt(ops.length)];
}
abstract String generateExpression();
abstract boolean isValidForLevel(String expression);
protected int countOperands(String expression) {
int count = 0;
Pattern pattern = Pattern.compile("\\d+");
Matcher matcher = pattern.matcher(expression);
while (matcher.find()) {
count++;
}
return count;
}
public String generateQuestion() {
String expression;
do {
expression = generateExpression();
} while (countOperands(expression) < 1 || countOperands(expression) > 5 || !isValidForLevel(expression));
return expression + " =";
}
}

@ -1,26 +0,0 @@
import java.util.HashMap;
import java.util.Map;
public class Authenticator {
private final Map<String, User> users = new HashMap<>();
public Authenticator() {
users.put("张三1", new User("张三1", "123", Level.ELEMENTARY));
users.put("张三2", new User("张三2", "123", Level.ELEMENTARY));
users.put("张三3", new User("张三3", "123", Level.ELEMENTARY));
users.put("李四1", new User("李四1", "123", Level.JUNIOR));
users.put("李四2", new User("李四2", "123", Level.JUNIOR));
users.put("李四3", new User("李四3", "123", Level.JUNIOR));
users.put("王五1", new User("王五1", "123", Level.SENIOR));
users.put("王五2", new User("王五2", "123", Level.SENIOR));
users.put("王五3", new User("王五3", "123", Level.SENIOR));
}
public User login(String username, String password) {
User user = users.get(username);
if (user != null && user.password.equals(password)) {
return user;
}
return null;
}
}

@ -1,25 +0,0 @@
public class ElementaryGenerator extends AbstractQuestionGenerator{
public ElementaryGenerator() {
super(Level.ELEMENTARY);
}
@Override
String generateExpression() {
return generateSub(4);
}
private String generateSub(int depth) {
if (depth == 0 || random.nextDouble() < 0.4) {
return String.valueOf(getRandomNumber());
}
String left = generateSub(depth - 1);
String op = getRandomBinaryOp();
String right = generateSub(depth - 1);
return "(" + left + op + right + ")";
}
@Override
boolean isValidForLevel(String expression) {
return true;
}
}

@ -1,45 +0,0 @@
import java.util.HashSet;
import java.util.Set;
import java.io.*;
public class HistoryManager {
private final Set<String> existingQuestions = new HashSet<>();
public HistoryManager(String username) {
File folder = new File(username);
if (!folder.exists() && !folder.mkdir()) {
System.err.println("无法创建文件夹: " + username);
}
File[] files = folder.listFiles();
if (files != null) {
for (File file : files) {
if (file.isFile() && file.getName().endsWith(".txt")) {
try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
String line;
while ((line = reader.readLine()) != null) {
line = line.trim();
if (line.matches("^\\d+\\..*")) {
int dotIndex = line.indexOf('.');
String question = line.substring(dotIndex + 1).trim();
if (question.endsWith("=")) {
question = question.substring(0, question.length() - 1).trim();
}
existingQuestions.add(question);
}
}
} catch (IOException e) {
System.err.println("读取文件出错: " + file.getName());
}
}
}
}
}
public boolean isDuplicate(String question) {
return existingQuestions.contains(question);
}
public void add(String question) {
existingQuestions.add(question);
}
}

@ -1,34 +0,0 @@
public class JuniorGenerator extends AbstractQuestionGenerator{
public JuniorGenerator() {
super(Level.JUNIOR);
}
@Override
String generateExpression() {
return generateSub(4);
}
private String generateSub(int depth) {
if (depth == 0 || random.nextDouble() < 0.4) {
return String.valueOf(getRandomNumber());
}
double r = random.nextDouble();
if (r < 0.5) {
String left = generateSub(depth - 1);
String op = getRandomBinaryOp();
String right = generateSub(depth - 1);
return "(" + left + op + right + ")";
} else if (r < 0.75) {
String sub = generateSub(depth - 1);
return "sqrt(" + sub + ")";
} else {
String sub = generateSub(depth - 1);
return "(" + sub + ")^2";
}
}
@Override
boolean isValidForLevel(String expression) {
return expression.contains("sqrt") || expression.contains("^2");
}
}

@ -1,15 +0,0 @@
public enum Level {
ELEMENTARY("小学"),
JUNIOR("初中"),
SENIOR("高中");
private final String name;
Level(String name) {
this.name = name;
}
public String getName() {
return name;
}
}

@ -1,114 +0,0 @@
import java.util.*;
import java.io.*;
import java.text.SimpleDateFormat;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
Authenticator authenticator = new Authenticator();
User user;
while (true) {
System.out.print("请输入用户名和密码(空格隔开):");
String inputLine = scanner.nextLine().trim();
String[] input = inputLine.split("\\s+");
if (input.length != 2) {
System.out.println("请输入正确的用户名、密码");
continue;
}
user = authenticator.login(input[0], input[1]);
if (user == null) {
System.out.println("请输入正确的用户名、密码");
continue;
}
Level currentLevel = user.initialLevel;
HistoryManager history = new HistoryManager(user.username);
while (true) {
System.out.println("当前选择为" + currentLevel.getName() + " 出题");
System.out.print("准备生成" + currentLevel.getName() + " 数学题目,请输入生成题目数量(输入-1将退出当前用户重新登录");
String input_text = scanner.nextLine().trim();
if (input_text.startsWith("切换为")) {
String newLevelStr = input_text.substring("切换为".length()).trim();
Level newLevel = switch (newLevelStr) {
case "小学" -> Level.ELEMENTARY;
case "初中" -> Level.JUNIOR;
case "高中" -> Level.SENIOR;
default -> null;
};
if (newLevel != null) {
currentLevel = newLevel;
} else {
System.out.println("请输入小学、初中和高中三个选项中的一个");
}
continue;
}
int numQuestions;
try {
numQuestions = Integer.parseInt(input_text);
} catch (NumberFormatException e) {
System.out.println("无效输入");
continue;
}
if (numQuestions == -1) {
break;
}
if (numQuestions < 10 || numQuestions > 30) {
System.out.println("数量应在10-30");
continue;
}
AbstractQuestionGenerator generator = getGenerator(currentLevel);
List<String> questions = new ArrayList<>();
boolean failed = false;
for (int i = 0; i < numQuestions; i++) {
String question;
int attempts = 0;
do {
question = generator.generateQuestion();
attempts++;
if (attempts > 100) {
System.out.println("无法生成足够独特的题目");
failed = true;
break;
}
} while (history.isDuplicate(question));
if (failed) {
break;
}
questions.add(question);
history.add(question);
}
if (!questions.isEmpty() && !failed) {
Date now = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
String filename = sdf.format(now) + ".txt";
File folder = new File(user.username);
File file = new File(folder, filename);
try (PrintWriter writer = new PrintWriter(file)) {
for (int i = 0; i < questions.size(); i++) {
writer.println((i + 1) + ". " + questions.get(i));
writer.println();
}
} catch (IOException e) {
System.err.println("保存文件出错: " + e.getMessage());
}
}
}
}
}
private static AbstractQuestionGenerator getGenerator(Level level) {
return switch (level) {
case ELEMENTARY -> new ElementaryGenerator();
case JUNIOR -> new JuniorGenerator();
case SENIOR -> new SeniorGenerator();
//default -> throw new IllegalArgumentException("未知水平");
};
}
}

@ -1,33 +0,0 @@
public class SeniorGenerator extends AbstractQuestionGenerator{
public SeniorGenerator() {
super(Level.SENIOR);
}
@Override
String generateExpression() {
return generateSub(4);
}
private String generateSub(int depth) {
if (depth == 0 || random.nextDouble() < 0.4) {
return String.valueOf(getRandomNumber());
}
double r = random.nextDouble();
if (r < 0.5) {
String left = generateSub(depth - 1);
String op = getRandomBinaryOp();
String right = generateSub(depth - 1);
return "(" + left + op + right + ")";
} else {
String[] funcs = {"sin", "cos", "tan"};
String func = funcs[random.nextInt(funcs.length)];
String sub = generateSub(depth - 1);
return func + "(" + sub + ")";
}
}
@Override
boolean isValidForLevel(String expression) {
return expression.contains("sin") || expression.contains("cos") || expression.contains("tan");
}
}

@ -1,11 +0,0 @@
public class User {
String username;
String password;
Level initialLevel;
public User(String username, String password, Level initialLevel) {
this.username = username;
this.password = password;
this.initialLevel = initialLevel;
}
}

Binary file not shown.

Binary file not shown.

@ -1,20 +0,0 @@
1. (64-2) =
2. 62 =
3. 13 =
4. 78 =
5. 72 =
6. (53-(53/((38+98)*32))) =
7. (57-52) =
8. (57+14) =
9. (((17*(6-21))*93)+63) =
10. 15 =

@ -1,20 +0,0 @@
1. 70 =
2. 39 =
3. 47 =
4. (21*(64+80)) =
5. (32-32) =
6. (76-34) =
7. (27/8) =
8. (51*47) =
9. 9 =
10. 82 =

@ -1,42 +0,0 @@
1. (45-((1*75)*36)) =
2. 4 =
3. (((33+(69*44))-56)-76) =
4. 66 =
5. 27 =
6. 84 =
7. (6/77) =
8. 1 =
9. (79+27) =
10. (68+(92*(20*(55/1)))) =
11. 8 =
12. (67+(((49/50)/87)/23)) =
13. (18*((51-31)*48)) =
14. ((19*42)*29) =
15. 37 =
16. 63 =
17. (69*47) =
18. (((24/(40*17))*31)/93) =
19. 20 =
20. 3 =
21. 95 =

@ -1,20 +0,0 @@
1. (64-2) =
2. 62 =
3. 13 =
4. 78 =
5. 72 =
6. (53-(53/((38+98)*32))) =
7. (57-52) =
8. (57+14) =
9. (((17*(6-21))*93)+63) =
10. 15 =

@ -1,20 +0,0 @@
1. 70 =
2. 39 =
3. 47 =
4. (21*(64+80)) =
5. (32-32) =
6. (76-34) =
7. (27/8) =
8. (51*47) =
9. 9 =
10. 82 =

@ -1,42 +0,0 @@
1. (45-((1*75)*36)) =
2. 4 =
3. (((33+(69*44))-56)-76) =
4. 66 =
5. 27 =
6. 84 =
7. (6/77) =
8. 1 =
9. (79+27) =
10. (68+(92*(20*(55/1)))) =
11. 8 =
12. (67+(((49/50)/87)/23)) =
13. (18*((51-31)*48)) =
14. ((19*42)*29) =
15. 37 =
16. 63 =
17. (69*47) =
18. (((24/(40*17))*31)/93) =
19. 20 =
20. 3 =
21. 95 =

@ -1,30 +0,0 @@
1. 35 =
2. 91 =
3. 68 =
4. 2 =
5. 74 =
6. 80 =
7. (8/15) =
8. 93 =
9. (68/70) =
10. 8 =
11. (61-49) =
12. (2-16) =
13. (64-76) =
14. 5 =
15. 94 =

@ -1,60 +0,0 @@
1. (100/((72/91)+(33*87))) =
2. 84 =
3. 72 =
4. 34 =
5. (70+55) =
6. (35/14) =
7. (((26/34)-77)/26) =
8. 81 =
9. (55+30) =
10. (38*(((40*17)-44)-54)) =
11. (90/39) =
12. 15 =
13. (28+22) =
14. 3 =
15. 33 =
16. 46 =
17. 68 =
18. 38 =
19. 48 =
20. (36*53) =
21. ((12-((34+98)-49))*13) =
22. (6/(90*(42*(72/50)))) =
23. (52+87) =
24. 98 =
25. 90 =
26. ((86+43)-18) =
27. 64 =
28. 22 =
29. 89 =
30. 91 =

@ -1,60 +0,0 @@
1. 8 =
2. ((76+92)/52) =
3. 6 =
4. 31 =
5. (72+60) =
6. 54 =
7. ((58-93)*(66+34)) =
8. 4 =
9. 28 =
10. 43 =
11. 83 =
12. ((11+(49/(89*57)))+7) =
13. 75 =
14. 77 =
15. 9 =
16. (28*89) =
17. 74 =
18. 60 =
19. 56 =
20. 47 =
21. (22+(99-58)) =
22. (28*30) =
23. 67 =
24. 14 =
25. (10/(63*12)) =
26. ((84*17)/31) =
27. 70 =
28. 93 =
29. ((86-82)*(17/90)) =
30. 27 =

@ -1,60 +0,0 @@
1. (8*37) =
2. ((30/65)*85) =
3. 59 =
4. 79 =
5. 40 =
6. 45 =
7. (91*11) =
8. 65 =
9. (12-(5/((80/23)/9))) =
10. (28*(9+3)) =
11. ((((73-99)/84)-45)+40) =
12. 44 =
13. 36 =
14. ((48-(20-(39-74)))-22) =
15. 24 =
16. (54/32) =
17. (61*(((62-96)+70)-21)) =
18. 5 =
19. (81*55) =
20. ((9/(78*78))-44) =
21. 78 =
22. ((52+71)-66) =
23. ((74*(64/(92-85)))-55) =
24. 80 =
25. (((92/(71*15))/92)/46) =
26. 96 =
27. ((65/66)*79) =
28. (78-((68*(71+54))+19)) =
29. 1 =
30. (2-(27-(56/19))) =

@ -1,60 +0,0 @@
1. 61 =
2. 76 =
3. 94 =
4. (4-(((45/3)-70)*44)) =
5. 35 =
6. ((57-((44/68)*50))/11) =
7. ((2+19)/(23/84)) =
8. (((42+(30*27))*56)-10) =
9. ((39*18)*(100+5)) =
10. 12 =
11. 58 =
12. ((((64-28)/9)-20)+5) =
13. ((38+((68+18)/71))*76) =
14. (90*7) =
15. 100 =
16. ((15/(83+(29-77)))+90) =
17. ((((57*7)-1)-8)/97) =
18. 52 =
19. (73-16) =
20. (61+68) =
21. ((83/29)/80) =
22. 71 =
23. ((67*58)*42) =
24. 19 =
25. 55 =
26. (13/(53+(71*(82+2)))) =
27. (11/((14-(13+66))/67)) =
28. 69 =
29. (62-61) =
30. 51 =

@ -1,60 +0,0 @@
1. 11 =
2. ((((78/6)+4)*26)/81) =
3. 26 =
4. (19+(42/91)) =
5. (7+58) =
6. ((53+14)/26) =
7. 17 =
8. (56-(((81+82)+47)-52)) =
9. (69-(36*(2-71))) =
10. (95/(3/((98/43)-93))) =
11. (39-84) =
12. ((40+72)+(7*36)) =
13. (90-70) =
14. 23 =
15. (31*38) =
16. 92 =
17. 73 =
18. (61-((52/(96+31))+24)) =
19. ((30/(35/85))*29) =
20. 95 =
21. ((49*28)+51) =
22. 30 =
23. ((71*70)*11) =
24. 63 =
25. (((93+(87*79))+50)/14) =
26. (30/(40*14)) =
27. 37 =
28. 97 =
29. 87 =
30. (33*77) =

@ -1,60 +0,0 @@
1. 41 =
2. 99 =
3. (70+(64*20)) =
4. (63+97) =
5. ((20-(29-(53/24)))/58) =
6. (19-75) =
7. 53 =
8. ((70+53)+54) =
9. 7 =
10. (61/(87+((6-34)-69))) =
11. (88-((27+(32+51))-83)) =
12. (88-45) =
13. (75+(81+51)) =
14. (95*8) =
15. (18*((49+(28+81))/100)) =
16. (14+28) =
17. ((43*(30-(26*47)))*84) =
18. (87-95) =
19. 42 =
20. 29 =
21. (25+(27+(27*71))) =
22. 20 =
23. (50/99) =
24. 62 =
25. 18 =
26. ((61*(94/(65/16)))*48) =
27. (100+28) =
28. (13/8) =
29. 57 =
30. (((42-(93/8))+8)-27) =

@ -1,60 +0,0 @@
1. (56+41) =
2. (29-36) =
3. (99-((82/(91/13))-77)) =
4. ((43/((59*32)/70))+14) =
5. (57+(16*53)) =
6. ((((90*33)*68)-60)*61) =
7. (29/(96-(68+66))) =
8. (37/39) =
9. (28-24) =
10. 25 =
11. (70/44) =
12. (79-((50+(10*15))-83)) =
13. (57/45) =
14. (91/3) =
15. ((41+16)*65) =
16. 10 =
17. ((57-((29+82)*41))-33) =
18. ((73/(19-(7*17)))+99) =
19. 82 =
20. 16 =
21. ((96+(99+(17-37)))/9) =
22. (64*(94+((57+25)*20))) =
23. ((19*94)*38) =
24. (77*((20-36)+16)) =
25. ((((6/85)*34)/91)-13) =
26. ((((8+84)/14)-74)*70) =
27. (((78+(48-44))-21)*37) =
28. (68-65) =
29. ((13-33)*46) =
30. ((11*76)*92) =

@ -1,3 +1,3 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 默认忽略的文件
/shelf/
/workspace.xml

@ -0,0 +1 @@
AbstractQuestionGenerator.java

@ -1,16 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CheckStyle-IDEA" serialisationVersion="2">
<checkstyleVersion>11.0.1</checkstyleVersion>
<scanScope>JavaOnly</scanScope>
<copyLibs>true</copyLibs>
<option name="thirdPartyClasspath" />
<option name="activeLocationIds" />
<option name="locations">
<list>
<ConfigurationLocation id="bundled-sun-checks" type="BUNDLED" scope="All" description="Sun Checks">(bundled)</ConfigurationLocation>
<ConfigurationLocation id="bundled-google-checks" type="BUNDLED" scope="All" description="Google Checks">(bundled)</ConfigurationLocation>
</list>
</option>
</component>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CheckStyle-IDEA" serialisationVersion="2">
<checkstyleVersion>11.0.1</checkstyleVersion>
<scanScope>JavaOnly</scanScope>
<suppressErrors>true</suppressErrors>
<copyLibs>true</copyLibs>
<option name="thirdPartyClasspath" />
<option name="activeLocationIds">
<option value="bundled-google-checks" />
</option>
<option name="locations">
<list>
<ConfigurationLocation id="bundled-sun-checks" type="BUNDLED" scope="All" description="Sun Checks">(bundled)</ConfigurationLocation>
<ConfigurationLocation id="bundled-google-checks" type="BUNDLED" scope="All" description="Google Checks">(bundled)</ConfigurationLocation>
</list>
</option>
</component>
</project>

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="GoogleStyle" />
</state>
</component>

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

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

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

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

@ -1,3 +1,3 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 默认忽略的文件
/shelf/
/workspace.xml

@ -0,0 +1 @@
AbstractQuestionGenerator.java

@ -1,16 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CheckStyle-IDEA" serialisationVersion="2">
<checkstyleVersion>11.0.1</checkstyleVersion>
<scanScope>JavaOnly</scanScope>
<copyLibs>true</copyLibs>
<option name="thirdPartyClasspath" />
<option name="activeLocationIds" />
<option name="locations">
<list>
<ConfigurationLocation id="bundled-sun-checks" type="BUNDLED" scope="All" description="Sun Checks">(bundled)</ConfigurationLocation>
<ConfigurationLocation id="bundled-google-checks" type="BUNDLED" scope="All" description="Google Checks">(bundled)</ConfigurationLocation>
</list>
</option>
</component>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CheckStyle-IDEA" serialisationVersion="2">
<checkstyleVersion>11.0.1</checkstyleVersion>
<scanScope>JavaOnly</scanScope>
<suppressErrors>true</suppressErrors>
<copyLibs>true</copyLibs>
<option name="thirdPartyClasspath" />
<option name="activeLocationIds">
<option value="bundled-google-checks" />
</option>
<option name="locations">
<list>
<ConfigurationLocation id="bundled-sun-checks" type="BUNDLED" scope="All" description="Sun Checks">(bundled)</ConfigurationLocation>
<ConfigurationLocation id="bundled-google-checks" type="BUNDLED" scope="All" description="Google Checks">(bundled)</ConfigurationLocation>
</list>
</option>
</component>
</project>

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="GoogleStyle" />
</state>
</component>

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

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

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

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

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="689ca976-67e0-46b5-87ea-b229588804e5" name="更改" comment="">
<change beforePath="$PROJECT_DIR$/../../src/.idea/.gitignore" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/.idea/.name" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/.idea/checkstyle-idea.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/.idea/misc.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/.idea/modules.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/.idea/src.iml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/.idea/vcs.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/AbstractQuestionGenerator.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/Authenticator.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/ElementaryGenerator.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/HistoryManager.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/JuniorGenerator.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/Level.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/Main.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/SeniorGenerator.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/User.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/out/production/src/.idea/.gitignore" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/out/production/src/.idea/.name" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/out/production/src/.idea/checkstyle-idea.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/out/production/src/.idea/misc.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/out/production/src/.idea/modules.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/out/production/src/.idea/src.iml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/out/production/src/AbstractQuestionGenerator.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/out/production/src/Authenticator.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/out/production/src/ElementaryGenerator.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/out/production/src/HistoryManager.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/out/production/src/JuniorGenerator.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/out/production/src/Level.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/out/production/src/Main$1.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/out/production/src/Main.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/out/production/src/SeniorGenerator.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/out/production/src/User.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/out/production/src/张三1/2025-09-24-08-36-42.txt" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/out/production/src/张三1/2025-09-24-08-36-49.txt" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/out/production/src/张三1/2025-09-24-08-36-54.txt" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/张三1/2025-09-24-08-36-42.txt" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/张三1/2025-09-24-08-36-49.txt" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/张三1/2025-09-24-08-36-54.txt" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/张三1/2025-09-24-20-12-52.txt" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/张三1/2025-09-24-20-22-13.txt" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/张三1/2025-09-24-20-22-19.txt" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/张三1/2025-09-24-20-22-21.txt" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/张三1/2025-09-24-20-22-22.txt" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/张三1/2025-09-24-20-22-57.txt" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/张三1/2025-09-24-20-22-59.txt" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/张三1/2025-09-24-20-23-00.txt" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../../src/王五1/2025-09-24-20-13-46.txt" beforeDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/../.." />
</component>
<component name="ProjectColorInfo"><![CDATA[{
"associatedIndex": 5
}]]></component>
<component name="ProjectId" id="33HStCAZngWgCUEIJi9S6BMTqOe" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RunOnceActivity.ShowReadmeOnStart": "true",
"RunOnceActivity.git.unshallow": "true",
"git-widget-placeholder": "develop",
"kotlin-language-version-configured": "true",
"last_opened_file_path": "C:/Users/86186/Desktop/个人项目",
"应用程序.Main.executor": "Run"
}
}]]></component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="默认任务">
<changelist id="689ca976-67e0-46b5-87ea-b229588804e5" name="更改" comment="" />
<created>1758972717869</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1758972717869</updated>
</task>
<servers />
</component>
</project>

@ -0,0 +1,40 @@
1. (sqrt(sqrt(27 * 26)))^2 =
2. (65 * ((58 * 28)^2 * 27)) =
3. (((28)^2)^2 - (31)^2) =
4. sqrt(sqrt(sqrt(28 * 97))) =
5. sqrt(2) =
6. sqrt(((68)^2)^2) =
7. ((81)^2 / 29) =
8. (21 - 69)^2 =
9. (65 + (sqrt(58) * (sqrt(10) * 32))) =
10. ((63 - 71)^2 * 4)^2 =
11. sqrt(55 - 74) =
12. (sqrt(sqrt(39)) + 84) =
13. sqrt((85)^2 + 88) =
14. ((sqrt(sqrt(37)))^2)^2 =
15. (39)^2 =
16. ((sqrt(82) - sqrt(35)) / (62 + 85)) =
17. (sqrt(10) * 96) =
18. sqrt((57)^2) =
19. (((76 + 94)^2)^2)^2 =
20. sqrt(91) =

@ -0,0 +1,60 @@
1. (sin(9) * (2 * cos(3 * 29))) =
2. (46 - sin(13)) =
3. (cos(26 - sin(39)) / tan(47)) =
4. (((56 / (79 * 71)) * 44) * sin(56)) =
5. cos(tan(82 - 9) + ((27 - 84) + tan(6))) =
6. tan(tan((80 / 80) - (25 - 58))) =
7. cos(tan(sin(99 + 36))) =
8. sin(tan(48)) =
9. sin(sin(68)) =
10. cos(63) =
11. tan(34) =
12. (79 * (12 + cos(sin(66)))) =
13. tan(cos(55 - 43) * cos(18)) =
14. sin(23) =
15. cos(43) =
16. (cos(cos(45)) / 20) =
17. (tan(72) * tan(91)) =
18. cos(sin(tan(tan(17)))) =
19. (((sin(5) * tan(27)) * tan(tan(84))) - 48) =
20. (sin(56) * 7) =
21. (cos(cos(11 / 77)) * (sin(cos(37)) + tan(sin(8)))) =
22. tan(49) =
23. (cos(cos(31)) / (67 / sin(73 / 82))) =
24. (57 / ((53 - (44 / 32)) * tan(cos(56)))) =
25. sin(4) =
26. sin(cos(38)) =
27. sin(39) =
28. tan(cos(sin(53))) =
29. tan(87) =
30. sin(86 * sin(27)) =

@ -0,0 +1,60 @@
1. (88 / 49) =
2. ((70 - 95) - (25 + 91)) =
3. (69 * 98) =
4. (95 - (73 - (13 + (42 / 59)))) =
5. (((73 - 71) / 59) - 65) =
6. ((77 + 41) * 57) =
7. (64 / (12 - (55 * (14 / 94)))) =
8. (((21 / 80) + 78) / 23) =
9. (5 - 10) =
10. (92 / (64 / 86)) =
11. ((7 - 31) - 34) =
12. ((95 * 96) - 23) =
13. ((32 * 31) / 10) =
14. (51 + (48 * 9)) =
15. (86 + (56 + 6)) =
16. (87 * (51 + ((82 * 79) - 54))) =
17. (15 - 59) =
18. (9 * (43 * 47)) =
19. ((78 + 98) / (85 + 38)) =
20. (59 + (61 / 44)) =
21. (7 - (36 / (22 * 22))) =
22. (62 / 11) =
23. ((69 * (60 * 65)) - (37 + 83)) =
24. (59 + 8) =
25. ((54 / (51 - (39 - 90))) / 13) =
26. (83 + 94) =
27. (31 * 93) =
28. (((52 + 22) + (40 + 50)) / 63) =
29. ((78 - ((74 / 60) - 41)) / 11) =
30. (35 / 8) =

@ -0,0 +1,60 @@
1. 56 - 45 =
2. (65 - 9) * 30 =
3. (80 / 88) * 61 =
4. 41 * ((88 / 37) - 81) =
5. 75 * (55 / (73 * (67 / 23))) =
6. 63 - ((23 - 29) + 14) =
7. 27 / (27 + 82) =
8. 8 / 54 =
9. 25 - (((41 - 51) - 13) / 91) =
10. (67 / 53) - (2 - 62) =
11. 82 + 8 =
12. 74 / (21 - (77 - (95 + 3))) =
13. 15 / (24 / 50) =
14. 71 * (55 / (93 + (5 + 16))) =
15. 27 * ((93 + (83 * 34)) - 22) =
16. 85 + 95 =
17. 72 / 47 =
18. 74 + 1 =
19. (10 * 81) - 22 =
20. 84 / 89 =
21. 51 * 43 =
22. 67 / (34 * ((89 - 92) - 28)) =
23. 8 + (((25 * 7) * 36) * 20) =
24. 96 / 45 =
25. 3 + (23 / 10) =
26. (26 - (60 / 76)) / 92 =
27. 37 * (61 - (42 * 2)) =
28. 4 * 67 =
29. 14 - 53 =
30. 83 * (86 * 79) =

@ -0,0 +1,60 @@
1. 72 + 22 =
2. (29 / 23) + 77 =
3. 22 * 57 =
4. 36 - 91 =
5. 38 / (((17 / 10) - 46) * 14) =
6. 77 * (39 * ((42 + 86) / 64)) =
7. (80 * (31 - (39 * 49))) - 39 =
8. 21 / 94 =
9. 56 + 11 =
10. ((80 + (15 - 81)) - 65) / 69 =
11. 37 * 51 =
12. 35 / 77 =
13. (57 * 88) * 15 =
14. ((79 * (97 / 80)) - 99) / 32 =
15. (71 / (34 - 25)) - 77 =
16. 40 * ((98 - (2 - 42)) + 15) =
17. 79 + (22 * (10 * 71)) =
18. (9 + 53) * 90 =
19. 50 / 4 =
20. 28 * (28 * 19) =
21. 57 + 60 =
22. ((100 * (20 + 23)) - 33) - 7 =
23. (42 + 92) / 51 =
24. 20 * ((72 - (19 / 79)) - 76) =
25. ((51 + (30 * 44)) * 72) * 49 =
26. 26 + 74 =
27. (51 / 94) / 48 =
28. 38 * ((32 * 69) - (70 * 28)) =
29. 5 * (22 - (21 / 9)) =
30. 87 * 60 =

@ -0,0 +1,60 @@
1. 54 - 92 =
2. 26 / ((9 / 36) / 88) =
3. ((23 * (60 * 61)) * 50) + 91 =
4. (15 / 12) / 48 =
5. 17 * 45 =
6. ((71 * 44) + 36) - (95 + 68) =
7. (64 * 17) / 23 =
8. 91 + (((84 * 4) - 48) - 58) =
9. 3 * (76 + ((51 / 40) - 90)) =
10. 76 / (((94 * 46) / 70) - 47) =
11. 69 / ((78 + (96 + 35)) * 17) =
12. 52 - 29 =
13. 69 / 87 =
14. 11 - 20 =
15. (100 / 59) + 87 =
16. 22 / (47 + 79) =
17. 88 / (18 + (65 + 20)) =
18. 79 / 20 =
19. 45 - 75 =
20. 22 + 82 =
21. 30 - (28 * 36) =
22. (42 * ((50 - 29) / 66)) * 22 =
23. (85 + 48) + (6 * (57 / 6)) =
24. 35 + 77 =
25. 93 - 98 =
26. 30 / ((60 - 16) * 24) =
27. 56 - 32 =
28. 66 * 82 =
29. (5 - (51 - (31 * 82))) + 86 =
30. 68 - 37 =

@ -0,0 +1,60 @@
1. 79 + 100 =
2. (29 + (33 + (33 / 70))) + 87 =
3. 88 / (((31 - 16) - 68) * 23) =
4. 12 * 8 =
5. 62 / (35 - 3) =
6. (((83 - 14) - 62) / 43) - 60 =
7. (91 * (52 * 50)) + 19 =
8. 65 - (87 + 19) =
9. 66 / 51 =
10. 87 + 21 =
11. (13 + 10) / 70 =
12. 59 / 25 =
13. (43 + 50) / (75 - (94 - 76)) =
14. 44 + (73 * 43) =
15. 90 + 66 =
16. 15 + (54 * 25) =
17. 71 / (51 + 93) =
18. 84 / ((35 * 63) + (41 / 88)) =
19. 88 - (26 / 61) =
20. 3 / 94 =
21. 44 - ((59 * 49) / 78) =
22. 90 / 76 =
23. 27 / 33 =
24. 29 - 23 =
25. (((68 * 95) - 88) / 33) + 2 =
26. 77 - ((3 + 90) + 97) =
27. 3 / 45 =
28. 41 + (82 / ((3 + 40) * 60)) =
29. 13 + 50 =
30. (74 - (27 - 7)) / 14 =

@ -0,0 +1,60 @@
1. (63 * 84) / 16 =
2. ((74 / (100 / 13)) * 94) + 10 =
3. 86 + 41 =
4. 43 + (66 / (92 / 46)) =
5. 56 * (((33 / 23) / 6) + 16) =
6. 23 - 24 =
7. 59 + 3 =
8. 95 / 9 =
9. 45 - 25 =
10. (88 / 51) - 63 =
11. 76 / ((71 + (68 / 14)) + 26) =
12. 94 * 19 =
13. (46 + 96) + 92 =
14. 88 * (78 + 13) =
15. (21 * 48) - (54 - 3) =
16. (5 - 88) - 48 =
17. 93 * (99 * ((78 + 28) / 58)) =
18. 75 / ((13 - (87 + 47)) + 36) =
19. (46 / 63) / 46 =
20. 44 + (70 / 8) =
21. 77 - (83 - 33) =
22. 86 * (2 / 52) =
23. (64 / 42) / (66 / 77) =
24. 43 + 86 =
25. 52 / (38 - 33) =
26. 9 * 35 =
27. 27 + (((74 - 22) * 23) * 25) =
28. 85 - 19 =
29. 2 + (((84 / 77) - 53) + 33) =
30. 49 * (58 * 31) =

@ -0,0 +1,40 @@
1. 70 + (sin(82) * (tan(45) * tan(92))) =
2. sin(tan(69 / 44) / 62) =
3. sin(tan(5 - 36)) =
4. cos(87 + 21) + 53 =
5. tan(34) =
6. sin(tan(12)) =
7. cos(10) =
8. sin(57) =
9. tan(1) =
10. sin(tan(sin(76))) * (3 + 34) =
11. sin((tan(94) * 80) * (62 / (10 / 14))) =
12. 96 - sin(sin(26 - 64)) =
13. (48 / 97) / cos(17) =
14. tan(cos((89 + 11) - 57)) =
15. sin(100) =
16. cos(tan(63 / sin(91))) =
17. tan(9) =
18. cos((48 * 1) / cos(51)) - tan(68) =
19. 99 * cos(37) =
20. sin(sin(9) * 69) - (88 * (sin(57) - 95)) =

@ -0,0 +1,60 @@
1. (74 - 30) + 1 =
2. 86 * 73 =
3. (64 + (80 / (5 * 24))) - 46 =
4. 7 + 55 =
5. (20 / 48) + 10 =
6. 81 / 69 =
7. 84 + (50 * 79) =
8. (79 - 56) + 23 =
9. 97 + 21 =
10. 86 / 31 =
11. 4 - 56 =
12. 37 - 53 =
13. 56 / 36 =
14. 83 * (29 / 69) =
15. 71 / 64 =
16. 71 - 31 =
17. 94 - (58 + 36) =
18. (55 + 100) + (98 - (60 - 88)) =
19. (27 + 61) * (72 - 19) =
20. (69 / ((51 / 28) + 70)) - 66 =
21. 48 - 4 =
22. (69 + 77) * (31 / 73) =
23. 22 - (28 - 79) =
24. 41 - 14 =
25. (16 / 8) - 36 =
26. ((23 * 38) - 6) + 74 =
27. (14 - 34) + 39 =
28. 21 + 76 =
29. (82 + (32 + 67)) * 93 =
30. 61 + 82 =

@ -0,0 +1,20 @@
1. 8 =
2. (78*(77*(34-69))) =
3. 11 =
4. ((79+(91+7))+8) =
5. 85 =
6. ((78/76)*29) =
7. 72 =
8. 77 =
9. 4 =
10. 86 =

@ -0,0 +1,40 @@
1. ((((94*51)*80)-70)+87) =
2. 69 =
3. (31-(((20-96)-1)+56)) =
4. (29/(19*(70/(80/45)))) =
5. 54 =
6. (94+(((11*5)/30)/94)) =
7. (95*81) =
8. 62 =
9. (78/(77+72)) =
10. 31 =
11. 46 =
12. (22+(92*(45+(61+1)))) =
13. (17+12) =
14. (80*((60-(44/37))+31)) =
15. (90-(56*65)) =
16. 89 =
17. (62*(95*32)) =
18. (40-21) =
19. 87 =
20. (10-(98-58)) =

@ -0,0 +1,40 @@
1. 85 =
2. (88/68) =
3. 42 =
4. 97 =
5. 5 =
6. (48-(((92/15)+76)+78)) =
7. (33*95) =
8. 26 =
9. (6-((49/(21*31))*77)) =
10. (((53-(62+69))-43)*4) =
11. 29 =
12. 35 =
13. 40 =
14. 45 =
15. (9/76) =
16. ((57-(77/88))+34) =
17. ((31+(85-82))+(75/67)) =
18. (85+5) =
19. 39 =
20. 95 =

@ -0,0 +1,60 @@
1. 14 =
2. ((88/(69*(24+100)))+20) =
3. (((12/(30/99))/98)+66) =
4. (11*((47/(76*46))-75)) =
5. 76 =
6. 55 =
7. 34 =
8. 46 =
9. 37 =
10. 49 =
11. 60 =
12. 54 =
13. 9 =
14. ((85/77)/1) =
15. 63 =
16. (6*18) =
17. (62*(58+29)) =
18. 72 =
19. ((16*((42+35)/2))/13) =
20. 62 =
21. 73 =
22. (38+(56-44)) =
23. ((58-6)+(32*3)) =
24. ((9*(87/85))/(37+8)) =
25. (71/((86-2)+62)) =
26. 65 =
27. 61 =
28. 13 =
29. ((42*75)*(84+82)) =
30. (16+42) =

@ -0,0 +1,60 @@
1. sqrt((sqrt(70))^2) + (94 / 4)^2 =
2. (71 * (sqrt(5))^2) - (14)^2 =
3. (4)^2 * 87 =
4. sqrt(66) =
5. (99)^2 - 51 =
6. sqrt((24)^2) =
7. 90 - (74)^2 =
8. sqrt(73) =
9. ((sqrt(39))^2)^2 - 79 =
10. (14 - (37)^2) * (12)^2 =
11. (((89)^2)^2 * 45) + 89 =
12. (49)^2 =
13. ((47)^2)^2 =
14. ((7)^2 + 32) / sqrt(8) =
15. sqrt((88 + 48)^2) =
16. (sqrt(69) + 4)^2 / sqrt(100) =
17. (50)^2 =
18. (57)^2 =
19. (61 / (sqrt(78))^2)^2 =
20. (78)^2 =
21. sqrt(75) =
22. sqrt(((92)^2 - (87 / 39))^2) =
23. sqrt(6) =
24. ((30)^2 - 61) / 2 =
25. (sqrt(94 - sqrt(71)))^2 =
26. sqrt(57) =
27. (74)^2 =
28. 56 + ((6)^2 / 55) =
29. sqrt(sqrt(((79)^2)^2)) =
30. sqrt((6)^2) =

@ -0,0 +1,60 @@
1. (sqrt((11 + 76)^2))^2 =
2. (64 + 54) - sqrt(sqrt(61)) =
3. ((sqrt(9))^2)^2 / 26 =
4. ((95 * 48) / 50)^2 =
5. sqrt(74) =
6. sqrt((sqrt(26) + 52) * (95 + 100)^2) =
7. sqrt(sqrt(3) + 58) =
8. sqrt(((21 * 21) * (52 / 38)) + 9) =
9. sqrt((29)^2) =
10. (sqrt(100))^2 =
11. sqrt((46)^2 / 60) =
12. sqrt(98) + (((2)^2 + 38) + 63) =
13. sqrt(sqrt(64)) =
14. 92 + (69)^2 =
15. sqrt(61) =
16. sqrt(42) =
17. ((28)^2 / 39)^2 =
18. sqrt(25) =
19. (20)^2 - (68)^2 =
20. (sqrt(86) / 5)^2 / 9 =
21. (77)^2 - (52)^2 =
22. sqrt(4 - sqrt(86 / 59)) =
23. sqrt((sqrt(80) + 60) / (75 - 7)) =
24. (88)^2 * 80 =
25. sqrt(25) - sqrt(52) =
26. (sqrt(73))^2 =
27. (15)^2 =
28. sqrt(((76)^2)^2) =
29. sqrt(sqrt(sqrt(3) / (90)^2)) =
30. sqrt(8) =

@ -1,20 +1,20 @@
1. (96/cos(76)) =
2. sin(98) =
3. cos(43) =
4. tan(86) =
5. sin(cos((sin(92)/(12+27)))) =
6. cos(3) =
7. cos(84) =
8. tan(79) =
9. tan(29) =
10. cos(((98-51)/sin(35))) =
1. (96/cos(76)) =
2. sin(98) =
3. cos(43) =
4. tan(86) =
5. sin(cos((sin(92)/(12+27)))) =
6. cos(3) =
7. cos(84) =
8. tan(79) =
9. tan(29) =
10. cos(((98-51)/sin(35))) =

@ -0,0 +1,60 @@
package src.auth;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import src.model.Level;
import src.model.User;
/**
* .
* .
*/
public class Authenticator {
private final Map<String, User> users = new HashMap<>();
/**
* .
* .
*/
public Authenticator() {
users.put("张三1", new User("张三1", "123", Level.ELEMENTARY));
users.put("张三2", new User("张三2", "123", Level.ELEMENTARY));
users.put("张三3", new User("张三3", "123", Level.ELEMENTARY));
users.put("李四1", new User("李四1", "123", Level.JUNIOR));
users.put("李四2", new User("李四2", "123", Level.JUNIOR));
users.put("李四3", new User("李四3", "123", Level.JUNIOR));
users.put("王五1", new User("王五1", "123", Level.SENIOR));
users.put("王五2", new User("王五2", "123", Level.SENIOR));
users.put("王五3", new User("王五3", "123", Level.SENIOR));
}
/**
* .
* .
*
* @return null
*/
public User login() {
Scanner scanner = new Scanner(System.in);
System.out.print("请输入用户名和密码(空格隔开):");
String inputLine = scanner.nextLine().trim();
String[] input = inputLine.split("\\s+");
if (input.length != 2) {
System.out.println("请输入正确的用户名、密码");
return null;
}
User user = users.get(input[0]);
if (user != null && user.getPassword().equals(input[1])) {
return user;
}
System.out.println("请输入正确的用户名、密码");
return null;
}
}

@ -0,0 +1,140 @@
package src.history;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import src.model.User;
import src.question.AbstractQuestionGenerator;
import src.util.Question;
/**
* .
* .
*/
public class HistoryManager {
private final Set<String> existingQuestions = new HashSet<>();
/**
* .
* .
*
* @param username
*/
public HistoryManager(String username) {
File folder = new File(username);
if (!folder.exists() && !folder.mkdir()) {
System.err.println("无法创建文件夹: " + username);
}
File[] files = folder.listFiles();
if (files != null) {
for (File file : files) {
if (file.isFile() && file.getName().endsWith(".txt")) {
try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
String line;
while ((line = reader.readLine()) != null) {
line = line.trim();
if (line.matches("^\\d+\\..*")) {
int dotIndex = line.indexOf('.');
String question = line.substring(dotIndex + 1).trim();
if (question.endsWith("=")) {
question = question.substring(0, question.length() - 1).trim();
}
existingQuestions.add(question);
}
}
} catch (IOException e) {
System.err.println("读取文件出错: " + file.getName());
}
}
}
}
}
/**
* .
*
* @param question
* @return truefalse
*/
public boolean isDuplicate(String question) {
return existingQuestions.contains(question);
}
/**
* .
*
* @param question
*/
public void add(String question) {
existingQuestions.add(question);
}
/**
* .
*
* @param numQuestions
* @param generator
* @return
*/
public List<String> getQuestion(Integer numQuestions,
AbstractQuestionGenerator generator) {
List<String> questions = new ArrayList<>();
boolean failed = false;
for (int i = 0; i < numQuestions; i++) {
String question;
int attempts = 0;
final int maxAttempts = 100;
do {
question = Question.generateQuestion(generator);
attempts++;
if (attempts > maxAttempts) {
System.out.println("无法生成足够独特的题目");
failed = true;
break;
}
} while (isDuplicate(question));
if (failed) {
break;
}
questions.add(question);
add(question);
}
return questions;
}
/**
* .
*
* @param questions
* @param user
*/
public void saveFile(List<String> questions, User user) {
if (questions.isEmpty()) {
return;
}
Date now = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
String filename = sdf.format(now) + ".txt";
File folder = new File(user.getUsername());
File file = new File(folder, filename);
try (PrintWriter writer = new PrintWriter(file)) {
for (int i = 0; i < questions.size(); i++) {
writer.println((i + 1) + ". " + questions.get(i));
writer.println();
}
} catch (IOException e) {
System.err.println("保存文件出错: " + e.getMessage());
}
}
}

@ -0,0 +1,47 @@
package src.model;
/**
* .
* .
*/
public enum Level {
/**
* .
*/
ELEMENTARY("小学"),
/**
* .
*/
JUNIOR("初中"),
/**
* .
*/
SENIOR("高中");
/**
* .
*/
private final String name;
/**
* .
*
* @param name
*/
Level(String name) {
this.name = name;
}
/**
* .
*
* @return
*/
public String getName() {
return name;
}
}

@ -0,0 +1,39 @@
package src.model;
/**
* .
* .
*/
public class User {
private final String username;
private final String password;
private final Level initialLevel;
/**
* .
*
* @param username
* @param password
* @param initialLevel
*/
public User(String username, String password, Level initialLevel) {
this.username = username;
this.password = password;
this.initialLevel = initialLevel;
}
public String getPassword() {
return password;
}
public String getUsername() {
return username;
}
public Level getInitialLevel() {
return initialLevel;
}
}

@ -0,0 +1,57 @@
package src.question;
import java.util.Random;
import src.model.Level;
/**
* .
* .
*/
public abstract class AbstractQuestionGenerator {
protected final Random random = new Random();
protected final Level level;
/**
* .
*
* @param level
*/
public AbstractQuestionGenerator(Level level) {
this.level = level;
}
/**
* .
*
* @return 1-100
*/
protected int getRandomNumber() {
return random.nextInt(100) + 1;
}
/**
* .
*
* @return +-*/
*/
protected String getRandomBinaryOp() {
String[] ops = {"+", "-", "*", "/"};
return ops[random.nextInt(ops.length)];
}
/**
* .
*
* @return
*/
public abstract String generateExpression();
/**
* .
*
* @param expression
* @return truefalse
*/
public abstract boolean isValidForLevel(String expression);
}

@ -0,0 +1,58 @@
package src.question;
import src.model.Level;
/**
* .
* .
*/
public class ElementaryGenerator extends AbstractQuestionGenerator {
/**
* .
* .
*/
public ElementaryGenerator() {
super(Level.ELEMENTARY);
}
/**
* .
* 使.
*
* @return
*/
@Override
public String generateExpression() {
return generateSub(4);
}
/**
* .
* .
*
* @param depth
* @return
*/
private String generateSub(int depth) {
if ((depth == 0 || random.nextDouble() < 0.4) && depth != 4) {
return String.valueOf(getRandomNumber());
}
String left = generateSub(depth - 1);
String op = getRandomBinaryOp();
String right = generateSub(depth - 1);
return "(" + left + " " + op + " " + right + ")";
}
/**
* .
* true.
*
* @param expression
* @return true
*/
@Override
public boolean isValidForLevel(String expression) {
return true;
}
}

@ -0,0 +1,99 @@
package src.question;
import src.model.Level;
/**
* .
* .
*/
public class JuniorGenerator extends AbstractQuestionGenerator {
/**
* .
*/
private static final double SQRT_PROBABILITY = 0.75;
/**
* .
*/
private static final double SQUARE_PROBABILITY = 0.5;
/**
* .
*/
private static final double LEAF_PROBABILITY = 0.4;
/**
* .
*/
private static final int MAX_DEPTH = 4;
/**
* .
* .
*/
public JuniorGenerator() {
super(Level.JUNIOR);
}
/**
* .
* 使.
*
* @return
*/
@Override
public String generateExpression() {
return generateSub(MAX_DEPTH);
}
/**
* .
* .
*
* @param depth
* @return
*/
private String generateSub(int depth) {
if (depth == 0 || random.nextDouble() < LEAF_PROBABILITY) {
return String.valueOf(getRandomNumber());
}
double randomValue = random.nextDouble();
if (randomValue < SQUARE_PROBABILITY) {
// 生成二元运算
String left = generateSub(depth - 1);
String op = getRandomBinaryOp();
String right = generateSub(depth - 1);
return "(" + left + " " + op + " " + right + ")";
} else if (randomValue < SQRT_PROBABILITY) {
// 生成平方根运算
String sub = generateSub(depth - 1);
if (sub.charAt(0) == '(' && sub.charAt(sub.length() - 1) == ')') {
return "sqrt" + sub;
} else {
return "sqrt(" + sub + ")";
}
} else {
// 生成平方运算
String sub = generateSub(depth - 1);
if (sub.charAt(0) == '(' && sub.charAt(sub.length() - 1) == ')') {
return sub + "^2";
} else {
return "(" + sub + ")^2";
}
}
}
/**
* .
* .
*
* @param expression
* @return truefalse
*/
@Override
public boolean isValidForLevel(String expression) {
return expression.contains("sqrt") || expression.contains("^2");
}
}

@ -0,0 +1,92 @@
package src.question;
import src.model.Level;
/**
* .
* .
*/
public class SeniorGenerator extends AbstractQuestionGenerator {
/**
* .
*/
private static final double BINARY_OP_PROBABILITY = 0.5;
/**
* .
*/
private static final double LEAF_PROBABILITY = 0.4;
/**
* .
*/
private static final int MAX_DEPTH = 4;
/**
* .
*/
private static final String[] TRIGONOMETRIC_FUNCTIONS = {"sin", "cos", "tan"};
/**
* .
* .
*/
public SeniorGenerator() {
super(Level.SENIOR);
}
/**
* .
* 使.
*
* @return
*/
@Override
public String generateExpression() {
return generateSub(MAX_DEPTH);
}
/**
* .
* .
*
* @param depth
* @return
*/
private String generateSub(int depth) {
if (depth == 0 || random.nextDouble() < LEAF_PROBABILITY) {
return String.valueOf(getRandomNumber());
}
double randomValue = random.nextDouble();
if (randomValue < BINARY_OP_PROBABILITY) {
// 生成二元运算
String left = generateSub(depth - 1);
String op = getRandomBinaryOp();
String right = generateSub(depth - 1);
return "(" + left + " " + op + " " + right + ")";
} else {
// 生成三角函数运算
String func = TRIGONOMETRIC_FUNCTIONS[random.nextInt(TRIGONOMETRIC_FUNCTIONS.length)];
String sub = generateSub(depth - 1);
if (sub.charAt(0) == '(' && sub.charAt(sub.length() - 1) == ')') {
return func + sub;
} else {
return func + "(" + sub + ")";
}
}
}
/**
* .
* .
*
* @param expression
* @return truefalse
*/
@Override
public boolean isValidForLevel(String expression) {
return expression.contains("sin") || expression.contains("cos") || expression.contains("tan");
}
}

@ -0,0 +1,61 @@
package src.start;
import java.util.List;
import java.util.Scanner;
import src.auth.Authenticator;
import src.history.HistoryManager;
import src.model.Level;
import src.model.User;
import src.question.AbstractQuestionGenerator;
import src.util.Auth;
import src.util.Question;
/**
* .
*/
public class Main {
/**
* .
* .
*
* @param args
*/
public static void main(String[] args) {
Authenticator authenticator = new Authenticator();
Scanner scanner = new Scanner(System.in);
while (true) {
User user = authenticator.login();
if (user == null) {
continue;
}
Level currentLevel = user.getInitialLevel();
while (true) {
System.out.println("当前选择为" + currentLevel.getName() + "出题");
System.out.print("准备生成" + currentLevel.getName()
+ "数学题目,请输入生成题目数量(输入-1将退出当前用户重新登录");
String inputText = scanner.nextLine().trim();
// 检查是否需要切换难度级别
Level newLevel = Auth.getLevel(inputText, currentLevel);
if (newLevel != null) {
currentLevel = newLevel;
continue;
}
// 处理题目生成
AbstractQuestionGenerator generator = Question.getGenerator(currentLevel);
Integer numQuestions = Question.getQuestionAmount(inputText);
if (numQuestions == -1) {
break; // 退出当前用户,重新登录
}
if (numQuestions == 0) {
continue; // 输入无效,重新输入
}
// 生成并保存题目
HistoryManager historyManager = new HistoryManager(user.getUsername());
List<String> questions = historyManager.getQuestion(numQuestions, generator);
historyManager.saveFile(questions, user);
System.out.println("题目生成完成,已保存到用户文件夹。");
}
}
}
}

@ -0,0 +1,39 @@
package src.util;
import src.model.Level;
/**
* .
* .
*/
public class Auth {
/**
* .
* .
*
* @param inputText
* @param currentLevel
* @return
*/
public static Level getLevel(String inputText, Level currentLevel) {
if (inputText.startsWith("切换为")) {
String newLevelStr = inputText.substring("切换为".length()).trim();
Level newLevel = switch (newLevelStr) {
case "小学" -> Level.ELEMENTARY;
case "初中" -> Level.JUNIOR;
case "高中" -> Level.SENIOR;
default -> null;
};
if (newLevel != null) {
return newLevel;
} else {
System.out.println("请输入小学、初中和高中三个选项中的一个");
return currentLevel;
}
}
return null;
}
}

@ -0,0 +1,99 @@
package src.util;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import src.model.Level;
import src.question.AbstractQuestionGenerator;
import src.question.ElementaryGenerator;
import src.question.JuniorGenerator;
import src.question.SeniorGenerator;
/**
* .
*
*/
public class Question {
/**
* .
*
* @param inputText
* @return 0-1退
*/
public static Integer getQuestionAmount(String inputText) {
int numQuestions;
try {
numQuestions = Integer.parseInt(inputText);
} catch (NumberFormatException e) {
System.out.println("无效输入");
return 0;
}
if (numQuestions == -1) {
return -1;
}
if (numQuestions < 10 || numQuestions > 30) {
System.out.println("数量应在10-30");
return 0;
}
return numQuestions;
}
/**
* .
*
* @param level
* @return
*/
public static AbstractQuestionGenerator getGenerator(Level level) {
return switch (level) {
case ELEMENTARY -> new ElementaryGenerator();
case JUNIOR -> new JuniorGenerator();
case SENIOR -> new SeniorGenerator();
};
}
/**
* .
*
* @param expression .
* @return .
*/
public static String check(String expression) {
if (expression.charAt(0) == '(' && expression.charAt(expression.length() - 1) == ')') {
return expression.substring(1, expression.length() - 1);
}
return expression;
}
/**
* .
*
* @param expression
* @return
*/
public static int countOperands(String expression) {
int count = 0;
Pattern pattern = Pattern.compile("\\d+");
Matcher matcher = pattern.matcher(expression);
while (matcher.find()) {
count++;
}
return count;
}
/**
* .
*
* @return
*/
public static String generateQuestion(AbstractQuestionGenerator generator) {
String expression;
do {
expression = generator.generateExpression();
} while (countOperands(expression) < 1 || countOperands(expression) > 5
|| !generator.isValidForLevel(expression));
return check(expression) + " =";
}
}

@ -0,0 +1,40 @@
1. (sqrt(sqrt(27 * 26)))^2 =
2. (65 * ((58 * 28)^2 * 27)) =
3. (((28)^2)^2 - (31)^2) =
4. sqrt(sqrt(sqrt(28 * 97))) =
5. sqrt(2) =
6. sqrt(((68)^2)^2) =
7. ((81)^2 / 29) =
8. (21 - 69)^2 =
9. (65 + (sqrt(58) * (sqrt(10) * 32))) =
10. ((63 - 71)^2 * 4)^2 =
11. sqrt(55 - 74) =
12. (sqrt(sqrt(39)) + 84) =
13. sqrt((85)^2 + 88) =
14. ((sqrt(sqrt(37)))^2)^2 =
15. (39)^2 =
16. ((sqrt(82) - sqrt(35)) / (62 + 85)) =
17. (sqrt(10) * 96) =
18. sqrt((57)^2) =
19. (((76 + 94)^2)^2)^2 =
20. sqrt(91) =

@ -0,0 +1,60 @@
1. (sin(9) * (2 * cos(3 * 29))) =
2. (46 - sin(13)) =
3. (cos(26 - sin(39)) / tan(47)) =
4. (((56 / (79 * 71)) * 44) * sin(56)) =
5. cos(tan(82 - 9) + ((27 - 84) + tan(6))) =
6. tan(tan((80 / 80) - (25 - 58))) =
7. cos(tan(sin(99 + 36))) =
8. sin(tan(48)) =
9. sin(sin(68)) =
10. cos(63) =
11. tan(34) =
12. (79 * (12 + cos(sin(66)))) =
13. tan(cos(55 - 43) * cos(18)) =
14. sin(23) =
15. cos(43) =
16. (cos(cos(45)) / 20) =
17. (tan(72) * tan(91)) =
18. cos(sin(tan(tan(17)))) =
19. (((sin(5) * tan(27)) * tan(tan(84))) - 48) =
20. (sin(56) * 7) =
21. (cos(cos(11 / 77)) * (sin(cos(37)) + tan(sin(8)))) =
22. tan(49) =
23. (cos(cos(31)) / (67 / sin(73 / 82))) =
24. (57 / ((53 - (44 / 32)) * tan(cos(56)))) =
25. sin(4) =
26. sin(cos(38)) =
27. sin(39) =
28. tan(cos(sin(53))) =
29. tan(87) =
30. sin(86 * sin(27)) =

@ -0,0 +1,60 @@
1. (88 / 49) =
2. ((70 - 95) - (25 + 91)) =
3. (69 * 98) =
4. (95 - (73 - (13 + (42 / 59)))) =
5. (((73 - 71) / 59) - 65) =
6. ((77 + 41) * 57) =
7. (64 / (12 - (55 * (14 / 94)))) =
8. (((21 / 80) + 78) / 23) =
9. (5 - 10) =
10. (92 / (64 / 86)) =
11. ((7 - 31) - 34) =
12. ((95 * 96) - 23) =
13. ((32 * 31) / 10) =
14. (51 + (48 * 9)) =
15. (86 + (56 + 6)) =
16. (87 * (51 + ((82 * 79) - 54))) =
17. (15 - 59) =
18. (9 * (43 * 47)) =
19. ((78 + 98) / (85 + 38)) =
20. (59 + (61 / 44)) =
21. (7 - (36 / (22 * 22))) =
22. (62 / 11) =
23. ((69 * (60 * 65)) - (37 + 83)) =
24. (59 + 8) =
25. ((54 / (51 - (39 - 90))) / 13) =
26. (83 + 94) =
27. (31 * 93) =
28. (((52 + 22) + (40 + 50)) / 63) =
29. ((78 - ((74 / 60) - 41)) / 11) =
30. (35 / 8) =

@ -0,0 +1,60 @@
1. 56 - 45 =
2. (65 - 9) * 30 =
3. (80 / 88) * 61 =
4. 41 * ((88 / 37) - 81) =
5. 75 * (55 / (73 * (67 / 23))) =
6. 63 - ((23 - 29) + 14) =
7. 27 / (27 + 82) =
8. 8 / 54 =
9. 25 - (((41 - 51) - 13) / 91) =
10. (67 / 53) - (2 - 62) =
11. 82 + 8 =
12. 74 / (21 - (77 - (95 + 3))) =
13. 15 / (24 / 50) =
14. 71 * (55 / (93 + (5 + 16))) =
15. 27 * ((93 + (83 * 34)) - 22) =
16. 85 + 95 =
17. 72 / 47 =
18. 74 + 1 =
19. (10 * 81) - 22 =
20. 84 / 89 =
21. 51 * 43 =
22. 67 / (34 * ((89 - 92) - 28)) =
23. 8 + (((25 * 7) * 36) * 20) =
24. 96 / 45 =
25. 3 + (23 / 10) =
26. (26 - (60 / 76)) / 92 =
27. 37 * (61 - (42 * 2)) =
28. 4 * 67 =
29. 14 - 53 =
30. 83 * (86 * 79) =

@ -0,0 +1,60 @@
1. 72 + 22 =
2. (29 / 23) + 77 =
3. 22 * 57 =
4. 36 - 91 =
5. 38 / (((17 / 10) - 46) * 14) =
6. 77 * (39 * ((42 + 86) / 64)) =
7. (80 * (31 - (39 * 49))) - 39 =
8. 21 / 94 =
9. 56 + 11 =
10. ((80 + (15 - 81)) - 65) / 69 =
11. 37 * 51 =
12. 35 / 77 =
13. (57 * 88) * 15 =
14. ((79 * (97 / 80)) - 99) / 32 =
15. (71 / (34 - 25)) - 77 =
16. 40 * ((98 - (2 - 42)) + 15) =
17. 79 + (22 * (10 * 71)) =
18. (9 + 53) * 90 =
19. 50 / 4 =
20. 28 * (28 * 19) =
21. 57 + 60 =
22. ((100 * (20 + 23)) - 33) - 7 =
23. (42 + 92) / 51 =
24. 20 * ((72 - (19 / 79)) - 76) =
25. ((51 + (30 * 44)) * 72) * 49 =
26. 26 + 74 =
27. (51 / 94) / 48 =
28. 38 * ((32 * 69) - (70 * 28)) =
29. 5 * (22 - (21 / 9)) =
30. 87 * 60 =

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save