Binary file not shown.
Binary file not shown.
@ -1,4 +1,4 @@
|
||||
#include "include/auth.hpp"
|
||||
#include "include/auth.h"
|
||||
|
||||
namespace meg {
|
||||
|
||||
@ -0,0 +1,50 @@
|
||||
#ifndef MEG_EXAM_H_
|
||||
#define MEG_EXAM_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <unordered_set>
|
||||
#include <filesystem>
|
||||
#include <random>
|
||||
#include "utils.h"
|
||||
|
||||
namespace meg {
|
||||
|
||||
// 抽象题目生成器接口:定义题目生成与历史管理的统一协议
|
||||
class IExamGenerator {
|
||||
public:
|
||||
virtual ~IExamGenerator() = default;
|
||||
// 加载历史:用于避免重复题目
|
||||
virtual std::unordered_set<std::string> load_history(const std::filesystem::path& history_path) = 0;
|
||||
// 追加历史:将本次生成写入历史库
|
||||
virtual void append_history(const std::filesystem::path& history_path, const std::vector<std::string>& qs) = 0;
|
||||
// 生成不重复题目:按难度与数量生成题目,排除历史
|
||||
virtual std::vector<std::string> GenerateUnique(Level level, int count, std::unordered_set<std::string>& history) = 0;
|
||||
};
|
||||
|
||||
// 具体题目生成器实现:使用随机数生成不同难度的题目
|
||||
class ExamGenerator : public IExamGenerator {
|
||||
public:
|
||||
ExamGenerator();
|
||||
// 加载历史:从文件读取每行题目为历史集合
|
||||
std::unordered_set<std::string> load_history(const std::filesystem::path& history_path) override;
|
||||
// 追加历史:将题目列表逐行追加到文件末尾
|
||||
void append_history(const std::filesystem::path& history_path, const std::vector<std::string>& qs) override;
|
||||
|
||||
// 生成不重复题目:依据难度选择生成函数并去重
|
||||
std::vector<std::string> GenerateUnique(Level level, int count, std::unordered_set<std::string>& history) override;
|
||||
|
||||
private:
|
||||
std::mt19937 rng_;
|
||||
|
||||
// 生成小学难度题目
|
||||
std::string GenPrimary();
|
||||
// 生成初中难度题目
|
||||
std::string GenMiddle();
|
||||
// 生成高中难度题目
|
||||
std::string GenHigh();
|
||||
};
|
||||
|
||||
} // namespace meg
|
||||
|
||||
#endif // MEG_EXAM_H_
|
||||
@ -1,33 +0,0 @@
|
||||
#ifndef MEG_EXAM_HPP
|
||||
#define MEG_EXAM_HPP
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <unordered_set>
|
||||
#include <filesystem>
|
||||
#include <random>
|
||||
#include "utils.hpp"
|
||||
|
||||
namespace meg {
|
||||
|
||||
class ExamGenerator {
|
||||
public:
|
||||
ExamGenerator();
|
||||
// 加载/保存历史,防止同教师重复题目
|
||||
std::unordered_set<std::string> load_history(const std::filesystem::path& history_path);
|
||||
void append_history(const std::filesystem::path& history_path, const std::vector<std::string>& qs);
|
||||
|
||||
// 生成不重复题目
|
||||
std::vector<std::string> generate_unique(Level level, int count, std::unordered_set<std::string>& history);
|
||||
|
||||
private:
|
||||
std::mt19937 rng_;
|
||||
|
||||
std::string gen_primary();
|
||||
std::string gen_middle();
|
||||
std::string gen_high();
|
||||
};
|
||||
|
||||
} // namespace meg
|
||||
|
||||
#endif // MEG_EXAM_HPP
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,10 @@
|
||||
#include "include/app.h"
|
||||
#include "include/utils.h"
|
||||
|
||||
int main() {
|
||||
// 主程序入口:安装 Ctrl+C 中断处理,确保交互过程优雅退出
|
||||
meg::InstallSignalHandlers();
|
||||
meg::App app;
|
||||
app.run();
|
||||
return 0;
|
||||
}
|
||||
@ -1,7 +0,0 @@
|
||||
#include "include/app.hpp"
|
||||
|
||||
int main() {
|
||||
meg::App app;
|
||||
app.run();
|
||||
return 0;
|
||||
}
|
||||
Binary file not shown.
@ -1,30 +1,180 @@
|
||||
40 + 31 * 38 = ?
|
||||
46 * 6 = ?
|
||||
(8) - 32 / 31 = ?
|
||||
36 + 20 + 17 = ?
|
||||
(7) + 14 / 39 = ?
|
||||
(19) - 24 * 20 = ?
|
||||
(13) - 27 * 43 = ?
|
||||
43 / 17 - 39 = ?
|
||||
17 - 43 = ?
|
||||
9 / 30 = ?
|
||||
48 / 31 = ?
|
||||
17 - 24 = ?
|
||||
(3) - 23 * 30 = ?
|
||||
26 / 38 = ?
|
||||
(48) / 46 * 33 = ?
|
||||
11 * 7 = ?
|
||||
(47) / 17 * 31 = ?
|
||||
36 * 10 / 14 = ?
|
||||
47 * 23 / 32 = ?
|
||||
(29) - 14 * 33 = ?
|
||||
33 * 46 + 38 = ?
|
||||
(4) * 11 * 9 = ?
|
||||
(39) / 36 - 36 = ?
|
||||
25 - 4 = ?
|
||||
12 - 8 = ?
|
||||
39 - 32 = ?
|
||||
13 / 25 = ?
|
||||
40 - 43 = ?
|
||||
(48) + 44 + 28 = ?
|
||||
(12) / 9 + 44 = ?
|
||||
7 + 2 = ?
|
||||
(16 * 15) + 25 = ?
|
||||
(35 - 33) + 38 = ?
|
||||
3 - (32 * 47) = ?
|
||||
(15 + 4) + 26 = ?
|
||||
36 / 30 = ?
|
||||
50 / (6 - 11) = ?
|
||||
(3 + 25) + 3 = ?
|
||||
14 / 12 = ?
|
||||
26 + 1 = ?
|
||||
43 * (15 + 8) = ?
|
||||
30 * 10 = ?
|
||||
41 / 37 = ?
|
||||
38 + (30 / 28) = ?
|
||||
(38 * 27) * 45 = ?
|
||||
5 / 8 = ?
|
||||
43 - 35 = ?
|
||||
(6 / 39) + 44 = ?
|
||||
(47 / 6) * 40 = ?
|
||||
5 - 43 = ?
|
||||
(11 - 44) - 1 = ?
|
||||
30 - 36 = ?
|
||||
(44 + 43) / 38 = ?
|
||||
11 - 29 = ?
|
||||
2 - (18 - 17) = ?
|
||||
14 * (33 - 10) = ?
|
||||
46 - 27 = ?
|
||||
11 - 15 = ?
|
||||
39 / 4 = ?
|
||||
10 + (41 / 45) = ?
|
||||
46 = ?
|
||||
34 = ?
|
||||
47 / 37 / 27 * 20 = ?
|
||||
43 - 13 = ?
|
||||
35 + 49 - 40 = ?
|
||||
1 = ?
|
||||
48 + 50 / 15 / 31 = ?
|
||||
13 - 21 - 19 = ?
|
||||
3 / 29 * 45 + 40 = ?
|
||||
48 = ?
|
||||
40 * 43 / 27 - 28 = ?
|
||||
30 = ?
|
||||
1 - 4 = ?
|
||||
24 = ?
|
||||
35 = ?
|
||||
1 * 38 / 28 = ?
|
||||
11 = ?
|
||||
50 - 14 - 49 = ?
|
||||
14 / 1 = ?
|
||||
44 - 35 / 14 + 12 * 24 = ?
|
||||
50 + 48 / 49 - 23 + 35 = ?
|
||||
46 + 10 * 7 + 45 + 44 = ?
|
||||
43 + 32 = ?
|
||||
20 * 17 + 2 + 26 = ?
|
||||
8 * 4 - 17 + 33 = ?
|
||||
49 - 40 / 27 + 42 = ?
|
||||
42 + 24 + 42 * 6 / 8 = ?
|
||||
36 * 18 - 12 = ?
|
||||
11 - 31 = ?
|
||||
19 - 5 = ?
|
||||
22 = ?
|
||||
71 * 95 / 30 = ?
|
||||
100 * 14 / 30 + 26 = ?
|
||||
15 + 9 = ?
|
||||
25 = ?
|
||||
86 = ?
|
||||
66 / 58 / 97 * 19 = ?
|
||||
33 - 99 = ?
|
||||
5 = ?
|
||||
93 + 90 + 79 / 73 = ?
|
||||
33 / 73 - 12 / 100 / 31 = ?
|
||||
59 / 81 / 48 * 34 * 95 = ?
|
||||
21 * 38 - 87 / 46 - 3 = ?
|
||||
82 + 40 - 4 / 41 * 5 = ?
|
||||
9 - 17 = ?
|
||||
67 * 49 / 34 + 85 * 31 = ?
|
||||
86 / 43 = ?
|
||||
89 * 41 = ?
|
||||
26 + 4 - 29 / 59 = ?
|
||||
2 = ?
|
||||
85 * 60 * 1 = ?
|
||||
11 - 17 / 72 = ?
|
||||
83 + 5 * 58 + 92 + 68 = ?
|
||||
21 - 76 + 88 + 89 / 89 = ?
|
||||
62 - 79 = ?
|
||||
76 * 87 - 86 / 81 = ?
|
||||
22 / 22 * 78 * 36 = ?
|
||||
18 - 70 / 40 * 47 = ?
|
||||
46 - 26 = ?
|
||||
47 / 59 / 31 * 80 - 92 = ?
|
||||
sqrt(sin(30deg)) = ?
|
||||
(tan(45deg) * 27 + 60)^2 = ?
|
||||
sqrt(34 + cos(90deg) / 67) = ?
|
||||
24 - cos(90deg) / 70 = ?
|
||||
sqrt(92 * sin(90deg)) = ?
|
||||
(86 * 8 * 20 * cos(45deg) - 53)^2 = ?
|
||||
sqrt(58 - 1 + sin(45deg) / 87) = ?
|
||||
(sin(90deg) / 75)^2 = ?
|
||||
(97 - 88 * 6 * cos(60deg) + 79)^2 = ?
|
||||
(15 / cos(90deg) / 40 * 7 / 7)^2 = ?
|
||||
sqrt(93 + sin(90deg) * 95 - 21) = ?
|
||||
82 / tan(60deg) + 87 + 86 = ?
|
||||
(tan(90deg))^2 = ?
|
||||
(72 / sin(60deg) / 27 - 37 * 96)^2 = ?
|
||||
sqrt(cos(30deg)) = ?
|
||||
(59 + 2 * 16 * 5 - sin(30deg))^2 = ?
|
||||
sqrt(35 + 16 * 77 + tan(30deg) / 81) = ?
|
||||
sqrt(sin(60deg)) = ?
|
||||
sqrt(cos(60deg) / 23 + 60 / 75 * 63) = ?
|
||||
58 / 45 / cos(30deg) + 9 * 40 = ?
|
||||
sqrt(69 * sin(30deg) * 74) = ?
|
||||
(54 + 76 - 14 * cos(30deg) + 45)^2 = ?
|
||||
(43 * cos(45deg) / 8 * 70)^2 = ?
|
||||
(47 / sin(90deg))^2 = ?
|
||||
66 - 18 + 93 / sin(45deg) + 33 = ?
|
||||
(cos(45deg) + 2 / 98 + 50)^2 = ?
|
||||
(68 * 94 / 47 + sin(45deg))^2 = ?
|
||||
cos(60deg) = ?
|
||||
sqrt(92 - 38 + cos(90deg) / 54) = ?
|
||||
72 + 71 + cos(30deg) * 100 = ?
|
||||
53 - 93 / 33 + cos(60deg) - 35 = ?
|
||||
(97 + sin(90deg))^2 = ?
|
||||
(79 * 37 - tan(60deg) * 41 / 40)^2 = ?
|
||||
(cos(60deg))^2 = ?
|
||||
(85 * 40 * 91 - tan(90deg))^2 = ?
|
||||
9 + tan(45deg) + 27 = ?
|
||||
sqrt(72 + sin(30deg) / 37) = ?
|
||||
tan(90deg) + 20 / 31 - 67 = ?
|
||||
sqrt(98 * 94 / cos(60deg)) = ?
|
||||
tan(45deg) = ?
|
||||
sqrt(cos(30deg) * 20 + 36) = ?
|
||||
(38 - 98 + 11 / sin(45deg))^2 = ?
|
||||
(sin(90deg))^2 = ?
|
||||
(42 * sin(60deg) + 56)^2 = ?
|
||||
sqrt(38 / 11 * sin(60deg)) = ?
|
||||
sqrt(cos(60deg)) = ?
|
||||
(13 * cos(45deg) + 22 - 99 + 94)^2 = ?
|
||||
(11 - 74 * cos(30deg))^2 = ?
|
||||
(73 / tan(60deg) / 14)^2 = ?
|
||||
sqrt(tan(90deg) - 80 * 18 - 76 - 26) = ?
|
||||
(22 / cos(60deg) * 99 + 7)^2 = ?
|
||||
76 / 86 + tan(90deg) = ?
|
||||
(90 + tan(60deg) - 70)^2 = ?
|
||||
sqrt(tan(90deg)) = ?
|
||||
87 + 4 * cos(45deg) / 19 * 91 = ?
|
||||
(tan(90deg) - 59)^2 = ?
|
||||
sqrt(8 + 7 - 14 - cos(90deg) + 69) = ?
|
||||
(tan(30deg))^2 = ?
|
||||
(sin(60deg))^2 = ?
|
||||
sin(90deg) + 92 = ?
|
||||
14 - 61 * 93 = ?
|
||||
70 / 58 / 41 = ?
|
||||
45 = ?
|
||||
43 * 22 / 37 - 93 = ?
|
||||
70 / 5 * 87 + 11 - 64 = ?
|
||||
7 - 64 - 7 / 32 = ?
|
||||
64 + 47 = ?
|
||||
88 - 97 + 40 - 82 * 19 = ?
|
||||
100 = ?
|
||||
18 = ?
|
||||
70 = ?
|
||||
46 / 45 = ?
|
||||
19 * 53 + 71 - 51 = ?
|
||||
78 * 32 = ?
|
||||
98 + 92 * 42 * 65 = ?
|
||||
78 * 40 + 77 = ?
|
||||
16 + 63 * 2 + 22 * 37 = ?
|
||||
3 * 2 * 94 / 79 - 73 = ?
|
||||
44 - 4 = ?
|
||||
20 / 54 / 66 = ?
|
||||
60 / 68 / 17 + 76 = ?
|
||||
7 + 16 * 67 = ?
|
||||
12 = ?
|
||||
3 = ?
|
||||
99 / 61 + 5 = ?
|
||||
95 * 64 = ?
|
||||
94 = ?
|
||||
26 + 67 * 29 = ?
|
||||
49 / 83 * 77 / 69 = ?
|
||||
9 * 45 + 6 * 81 = ?
|
||||
|
||||
@ -1,60 +0,0 @@
|
||||
1. 40 + 31 * 38 = ?
|
||||
|
||||
2. 46 * 6 = ?
|
||||
|
||||
3. (8) - 32 / 31 = ?
|
||||
|
||||
4. 36 + 20 + 17 = ?
|
||||
|
||||
5. (7) + 14 / 39 = ?
|
||||
|
||||
6. (19) - 24 * 20 = ?
|
||||
|
||||
7. (13) - 27 * 43 = ?
|
||||
|
||||
8. 43 / 17 - 39 = ?
|
||||
|
||||
9. 17 - 43 = ?
|
||||
|
||||
10. 9 / 30 = ?
|
||||
|
||||
11. 48 / 31 = ?
|
||||
|
||||
12. 17 - 24 = ?
|
||||
|
||||
13. (3) - 23 * 30 = ?
|
||||
|
||||
14. 26 / 38 = ?
|
||||
|
||||
15. (48) / 46 * 33 = ?
|
||||
|
||||
16. 11 * 7 = ?
|
||||
|
||||
17. (47) / 17 * 31 = ?
|
||||
|
||||
18. 36 * 10 / 14 = ?
|
||||
|
||||
19. 47 * 23 / 32 = ?
|
||||
|
||||
20. (29) - 14 * 33 = ?
|
||||
|
||||
21. 33 * 46 + 38 = ?
|
||||
|
||||
22. (4) * 11 * 9 = ?
|
||||
|
||||
23. (39) / 36 - 36 = ?
|
||||
|
||||
24. 25 - 4 = ?
|
||||
|
||||
25. 12 - 8 = ?
|
||||
|
||||
26. 39 - 32 = ?
|
||||
|
||||
27. 13 / 25 = ?
|
||||
|
||||
28. 40 - 43 = ?
|
||||
|
||||
29. (48) + 44 + 28 = ?
|
||||
|
||||
30. (12) / 9 + 44 = ?
|
||||
|
||||
@ -0,0 +1,60 @@
|
||||
1. 7 + 2 = ?
|
||||
|
||||
2. (16 * 15) + 25 = ?
|
||||
|
||||
3. (35 - 33) + 38 = ?
|
||||
|
||||
4. 3 - (32 * 47) = ?
|
||||
|
||||
5. (15 + 4) + 26 = ?
|
||||
|
||||
6. 36 / 30 = ?
|
||||
|
||||
7. 50 / (6 - 11) = ?
|
||||
|
||||
8. (3 + 25) + 3 = ?
|
||||
|
||||
9. 14 / 12 = ?
|
||||
|
||||
10. 26 + 1 = ?
|
||||
|
||||
11. 43 * (15 + 8) = ?
|
||||
|
||||
12. 30 * 10 = ?
|
||||
|
||||
13. 41 / 37 = ?
|
||||
|
||||
14. 38 + (30 / 28) = ?
|
||||
|
||||
15. (38 * 27) * 45 = ?
|
||||
|
||||
16. 5 / 8 = ?
|
||||
|
||||
17. 43 - 35 = ?
|
||||
|
||||
18. (6 / 39) + 44 = ?
|
||||
|
||||
19. (47 / 6) * 40 = ?
|
||||
|
||||
20. 5 - 43 = ?
|
||||
|
||||
21. (11 - 44) - 1 = ?
|
||||
|
||||
22. 30 - 36 = ?
|
||||
|
||||
23. (44 + 43) / 38 = ?
|
||||
|
||||
24. 11 - 29 = ?
|
||||
|
||||
25. 2 - (18 - 17) = ?
|
||||
|
||||
26. 14 * (33 - 10) = ?
|
||||
|
||||
27. 46 - 27 = ?
|
||||
|
||||
28. 11 - 15 = ?
|
||||
|
||||
29. 39 / 4 = ?
|
||||
|
||||
30. 10 + (41 / 45) = ?
|
||||
|
||||
@ -0,0 +1,60 @@
|
||||
1. 46 = ?
|
||||
|
||||
2. 34 = ?
|
||||
|
||||
3. 47 / 37 / 27 * 20 = ?
|
||||
|
||||
4. 43 - 13 = ?
|
||||
|
||||
5. 35 + 49 - 40 = ?
|
||||
|
||||
6. 1 = ?
|
||||
|
||||
7. 48 + 50 / 15 / 31 = ?
|
||||
|
||||
8. 13 - 21 - 19 = ?
|
||||
|
||||
9. 3 / 29 * 45 + 40 = ?
|
||||
|
||||
10. 48 = ?
|
||||
|
||||
11. 40 * 43 / 27 - 28 = ?
|
||||
|
||||
12. 30 = ?
|
||||
|
||||
13. 1 - 4 = ?
|
||||
|
||||
14. 24 = ?
|
||||
|
||||
15. 35 = ?
|
||||
|
||||
16. 1 * 38 / 28 = ?
|
||||
|
||||
17. 11 = ?
|
||||
|
||||
18. 50 - 14 - 49 = ?
|
||||
|
||||
19. 14 / 1 = ?
|
||||
|
||||
20. 44 - 35 / 14 + 12 * 24 = ?
|
||||
|
||||
21. 50 + 48 / 49 - 23 + 35 = ?
|
||||
|
||||
22. 46 + 10 * 7 + 45 + 44 = ?
|
||||
|
||||
23. 43 + 32 = ?
|
||||
|
||||
24. 20 * 17 + 2 + 26 = ?
|
||||
|
||||
25. 8 * 4 - 17 + 33 = ?
|
||||
|
||||
26. 49 - 40 / 27 + 42 = ?
|
||||
|
||||
27. 42 + 24 + 42 * 6 / 8 = ?
|
||||
|
||||
28. 36 * 18 - 12 = ?
|
||||
|
||||
29. 11 - 31 = ?
|
||||
|
||||
30. 19 - 5 = ?
|
||||
|
||||
@ -0,0 +1,60 @@
|
||||
1. 22 = ?
|
||||
|
||||
2. 71 * 95 / 30 = ?
|
||||
|
||||
3. 100 * 14 / 30 + 26 = ?
|
||||
|
||||
4. 15 + 9 = ?
|
||||
|
||||
5. 25 = ?
|
||||
|
||||
6. 86 = ?
|
||||
|
||||
7. 66 / 58 / 97 * 19 = ?
|
||||
|
||||
8. 33 - 99 = ?
|
||||
|
||||
9. 5 = ?
|
||||
|
||||
10. 93 + 90 + 79 / 73 = ?
|
||||
|
||||
11. 33 / 73 - 12 / 100 / 31 = ?
|
||||
|
||||
12. 59 / 81 / 48 * 34 * 95 = ?
|
||||
|
||||
13. 21 * 38 - 87 / 46 - 3 = ?
|
||||
|
||||
14. 82 + 40 - 4 / 41 * 5 = ?
|
||||
|
||||
15. 9 - 17 = ?
|
||||
|
||||
16. 67 * 49 / 34 + 85 * 31 = ?
|
||||
|
||||
17. 86 / 43 = ?
|
||||
|
||||
18. 89 * 41 = ?
|
||||
|
||||
19. 26 + 4 - 29 / 59 = ?
|
||||
|
||||
20. 2 = ?
|
||||
|
||||
21. 85 * 60 * 1 = ?
|
||||
|
||||
22. 11 - 17 / 72 = ?
|
||||
|
||||
23. 83 + 5 * 58 + 92 + 68 = ?
|
||||
|
||||
24. 21 - 76 + 88 + 89 / 89 = ?
|
||||
|
||||
25. 62 - 79 = ?
|
||||
|
||||
26. 76 * 87 - 86 / 81 = ?
|
||||
|
||||
27. 22 / 22 * 78 * 36 = ?
|
||||
|
||||
28. 18 - 70 / 40 * 47 = ?
|
||||
|
||||
29. 46 - 26 = ?
|
||||
|
||||
30. 47 / 59 / 31 * 80 - 92 = ?
|
||||
|
||||
@ -0,0 +1,60 @@
|
||||
1. sqrt(sin(30deg)) = ?
|
||||
|
||||
2. (tan(45deg) * 27 + 60)^2 = ?
|
||||
|
||||
3. sqrt(34 + cos(90deg) / 67) = ?
|
||||
|
||||
4. 24 - cos(90deg) / 70 = ?
|
||||
|
||||
5. sqrt(92 * sin(90deg)) = ?
|
||||
|
||||
6. (86 * 8 * 20 * cos(45deg) - 53)^2 = ?
|
||||
|
||||
7. sqrt(58 - 1 + sin(45deg) / 87) = ?
|
||||
|
||||
8. (sin(90deg) / 75)^2 = ?
|
||||
|
||||
9. (97 - 88 * 6 * cos(60deg) + 79)^2 = ?
|
||||
|
||||
10. (15 / cos(90deg) / 40 * 7 / 7)^2 = ?
|
||||
|
||||
11. sqrt(93 + sin(90deg) * 95 - 21) = ?
|
||||
|
||||
12. 82 / tan(60deg) + 87 + 86 = ?
|
||||
|
||||
13. (tan(90deg))^2 = ?
|
||||
|
||||
14. (72 / sin(60deg) / 27 - 37 * 96)^2 = ?
|
||||
|
||||
15. sqrt(cos(30deg)) = ?
|
||||
|
||||
16. (59 + 2 * 16 * 5 - sin(30deg))^2 = ?
|
||||
|
||||
17. sqrt(35 + 16 * 77 + tan(30deg) / 81) = ?
|
||||
|
||||
18. sqrt(sin(60deg)) = ?
|
||||
|
||||
19. sqrt(cos(60deg) / 23 + 60 / 75 * 63) = ?
|
||||
|
||||
20. 58 / 45 / cos(30deg) + 9 * 40 = ?
|
||||
|
||||
21. sqrt(69 * sin(30deg) * 74) = ?
|
||||
|
||||
22. (54 + 76 - 14 * cos(30deg) + 45)^2 = ?
|
||||
|
||||
23. (43 * cos(45deg) / 8 * 70)^2 = ?
|
||||
|
||||
24. (47 / sin(90deg))^2 = ?
|
||||
|
||||
25. 66 - 18 + 93 / sin(45deg) + 33 = ?
|
||||
|
||||
26. (cos(45deg) + 2 / 98 + 50)^2 = ?
|
||||
|
||||
27. (68 * 94 / 47 + sin(45deg))^2 = ?
|
||||
|
||||
28. cos(60deg) = ?
|
||||
|
||||
29. sqrt(92 - 38 + cos(90deg) / 54) = ?
|
||||
|
||||
30. 72 + 71 + cos(30deg) * 100 = ?
|
||||
|
||||
@ -0,0 +1,60 @@
|
||||
1. 53 - 93 / 33 + cos(60deg) - 35 = ?
|
||||
|
||||
2. (97 + sin(90deg))^2 = ?
|
||||
|
||||
3. (79 * 37 - tan(60deg) * 41 / 40)^2 = ?
|
||||
|
||||
4. (cos(60deg))^2 = ?
|
||||
|
||||
5. (85 * 40 * 91 - tan(90deg))^2 = ?
|
||||
|
||||
6. 9 + tan(45deg) + 27 = ?
|
||||
|
||||
7. sqrt(72 + sin(30deg) / 37) = ?
|
||||
|
||||
8. tan(90deg) + 20 / 31 - 67 = ?
|
||||
|
||||
9. sqrt(98 * 94 / cos(60deg)) = ?
|
||||
|
||||
10. tan(45deg) = ?
|
||||
|
||||
11. sqrt(cos(30deg) * 20 + 36) = ?
|
||||
|
||||
12. (38 - 98 + 11 / sin(45deg))^2 = ?
|
||||
|
||||
13. (sin(90deg))^2 = ?
|
||||
|
||||
14. (42 * sin(60deg) + 56)^2 = ?
|
||||
|
||||
15. sqrt(38 / 11 * sin(60deg)) = ?
|
||||
|
||||
16. sqrt(cos(60deg)) = ?
|
||||
|
||||
17. (13 * cos(45deg) + 22 - 99 + 94)^2 = ?
|
||||
|
||||
18. (11 - 74 * cos(30deg))^2 = ?
|
||||
|
||||
19. (73 / tan(60deg) / 14)^2 = ?
|
||||
|
||||
20. sqrt(tan(90deg) - 80 * 18 - 76 - 26) = ?
|
||||
|
||||
21. (22 / cos(60deg) * 99 + 7)^2 = ?
|
||||
|
||||
22. 76 / 86 + tan(90deg) = ?
|
||||
|
||||
23. (90 + tan(60deg) - 70)^2 = ?
|
||||
|
||||
24. sqrt(tan(90deg)) = ?
|
||||
|
||||
25. 87 + 4 * cos(45deg) / 19 * 91 = ?
|
||||
|
||||
26. (tan(90deg) - 59)^2 = ?
|
||||
|
||||
27. sqrt(8 + 7 - 14 - cos(90deg) + 69) = ?
|
||||
|
||||
28. (tan(30deg))^2 = ?
|
||||
|
||||
29. (sin(60deg))^2 = ?
|
||||
|
||||
30. sin(90deg) + 92 = ?
|
||||
|
||||
@ -0,0 +1,60 @@
|
||||
1. 14 - 61 * 93 = ?
|
||||
|
||||
2. 70 / 58 / 41 = ?
|
||||
|
||||
3. 45 = ?
|
||||
|
||||
4. 43 * 22 / 37 - 93 = ?
|
||||
|
||||
5. 70 / 5 * 87 + 11 - 64 = ?
|
||||
|
||||
6. 7 - 64 - 7 / 32 = ?
|
||||
|
||||
7. 64 + 47 = ?
|
||||
|
||||
8. 88 - 97 + 40 - 82 * 19 = ?
|
||||
|
||||
9. 100 = ?
|
||||
|
||||
10. 18 = ?
|
||||
|
||||
11. 70 = ?
|
||||
|
||||
12. 46 / 45 = ?
|
||||
|
||||
13. 19 * 53 + 71 - 51 = ?
|
||||
|
||||
14. 78 * 32 = ?
|
||||
|
||||
15. 98 + 92 * 42 * 65 = ?
|
||||
|
||||
16. 78 * 40 + 77 = ?
|
||||
|
||||
17. 16 + 63 * 2 + 22 * 37 = ?
|
||||
|
||||
18. 3 * 2 * 94 / 79 - 73 = ?
|
||||
|
||||
19. 44 - 4 = ?
|
||||
|
||||
20. 20 / 54 / 66 = ?
|
||||
|
||||
21. 60 / 68 / 17 + 76 = ?
|
||||
|
||||
22. 7 + 16 * 67 = ?
|
||||
|
||||
23. 12 = ?
|
||||
|
||||
24. 3 = ?
|
||||
|
||||
25. 99 / 61 + 5 = ?
|
||||
|
||||
26. 95 * 64 = ?
|
||||
|
||||
27. 94 = ?
|
||||
|
||||
28. 26 + 67 * 29 = ?
|
||||
|
||||
29. 49 / 83 * 77 / 69 = ?
|
||||
|
||||
30. 9 * 45 + 6 * 81 = ?
|
||||
|
||||
@ -1,74 +0,0 @@
|
||||
#include "include/utils.hpp"
|
||||
|
||||
#include <locale>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
#include <chrono>
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <io.h>
|
||||
# include <fcntl.h>
|
||||
#endif
|
||||
|
||||
namespace meg {
|
||||
|
||||
std::wstring level_to_chinese(Level level) {
|
||||
switch (level) {
|
||||
case Level::Primary: return L"小学";
|
||||
case Level::Middle: return L"初中";
|
||||
case Level::High: return L"高中";
|
||||
}
|
||||
return L"小学";
|
||||
}
|
||||
|
||||
void init_console_locale() {
|
||||
#ifdef _WIN32
|
||||
_setmode(_fileno(stdout), _O_U16TEXT);
|
||||
_setmode(_fileno(stdin), _O_U16TEXT);
|
||||
_setmode(_fileno(stderr), _O_U16TEXT);
|
||||
#else
|
||||
try {
|
||||
std::locale loc("");
|
||||
std::locale::global(loc);
|
||||
std::wcout.imbue(loc);
|
||||
std::wcin.imbue(loc);
|
||||
std::wcerr.imbue(loc);
|
||||
} catch (...) {
|
||||
// 忽略本地化设置失败
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string now_timestamp_str() {
|
||||
using namespace std::chrono;
|
||||
auto now = system_clock::now();
|
||||
std::time_t t = system_clock::to_time_t(now);
|
||||
std::tm tm{};
|
||||
#ifdef _WIN32
|
||||
localtime_s(&tm, &t);
|
||||
#else
|
||||
localtime_r(&t, &tm);
|
||||
#endif
|
||||
std::ostringstream oss;
|
||||
oss << std::put_time(&tm, "%Y-%m-%d-%H-%M-%S");
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
bool starts_with(const std::wstring& s, const std::wstring& prefix) {
|
||||
if (prefix.size() > s.size()) return false;
|
||||
return std::equal(prefix.begin(), prefix.end(), s.begin());
|
||||
}
|
||||
|
||||
static inline bool is_space(wchar_t c) {
|
||||
return c == L' ' || c == L'\t' || c == L'\n' || c == L'\r' || c == L'\f' || c == L'\v';
|
||||
}
|
||||
|
||||
std::wstring trim(const std::wstring& s) {
|
||||
size_t b = 0, e = s.size();
|
||||
while (b < e && is_space(s[b])) ++b;
|
||||
while (e > b && is_space(s[e-1])) --e;
|
||||
return s.substr(b, e - b);
|
||||
}
|
||||
|
||||
} // namespace meg
|
||||
Loading…
Reference in new issue