From a42c5e897b8844d07bed712f3807c452164f2efb Mon Sep 17 00:00:00 2001 From: deyuanw <@ bzu.edu.cn> Date: Tue, 25 Apr 2023 19:54:55 +0800 Subject: [PATCH 01/14] 1 --- picture.1drawio.svg | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 picture.1drawio.svg diff --git a/picture.1drawio.svg b/picture.1drawio.svg new file mode 100644 index 0000000..e69de29 From 99409eca986d26d48d2cd8ce6e009f4eca401e10 Mon Sep 17 00:00:00 2001 From: deyuanw <@ bzu.edu.cn> Date: Tue, 25 Apr 2023 20:05:41 +0800 Subject: [PATCH 02/14] 1 --- picture.1drawio.svg | 0 picture1.drawio.svg | 153 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 153 insertions(+) delete mode 100644 picture.1drawio.svg create mode 100644 picture1.drawio.svg diff --git a/picture.1drawio.svg b/picture.1drawio.svg deleted file mode 100644 index e69de29..0000000 diff --git a/picture1.drawio.svg b/picture1.drawio.svg new file mode 100644 index 0000000..51710f7 --- /dev/null +++ b/picture1.drawio.svg @@ -0,0 +1,153 @@ + + + + + + + + + + + 输入学生学号 + + + + + + 输入学生学号 + + + + + + + + + + + + + 判断学号是否存在 + + + + + + 判断学号是否存在 + + + + + + + + + + + + + 删除 + + + + + + 删除 + + + + + + + + + + + + 提示不存在并结束 + + + + + + 提示不存在并结束 + + + + + + + + + + + 存在 + + + + + + 存在 + + + + + + + + + + + 不存在 + + + + + + 不存在 + + + + + + + + + + + + + + + + + delete_data + + + + + + + + + + + + + + + delete_data... + + + + + + + + + + Text is not SVG - cannot display + + + + \ No newline at end of file From a540ede5230dc5759f792722dea909c0a8888df4 Mon Sep 17 00:00:00 2001 From: deyuanw <@ bzu.edu.cn> Date: Tue, 25 Apr 2023 20:15:02 +0800 Subject: [PATCH 03/14] 1 --- picture2.drawio.svg | 137 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 picture2.drawio.svg diff --git a/picture2.drawio.svg b/picture2.drawio.svg new file mode 100644 index 0000000..eca14be --- /dev/null +++ b/picture2.drawio.svg @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + update_data + + + + + + + + + + + + + + + update_data... + + + + + + + + + + + + + + 输入学生学号 + + + + + + 输入学生学号 + + + + + + + + + + + + + + 查找学生是否已经能够录入 + + + + + + 查找学生是否已经能够录入 + + + + + + + + + + + 不存在 + + + + + + 不存在 + + + + + + + + + + + 存在 + + + + + + 存在 + + + + + + + + + + + 退出 + + + + + + 退出 + + + + + + + + + + Text is not SVG - cannot display + + + + \ No newline at end of file From 39a4122ea95b2b913631c4ead8c200227299eef3 Mon Sep 17 00:00:00 2001 From: deyuanw <@ bzu.edu.cn> Date: Tue, 25 Apr 2023 20:15:58 +0800 Subject: [PATCH 04/14] 1 --- picture2.drawio.svg | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/picture2.drawio.svg b/picture2.drawio.svg index eca14be..70038a5 100644 --- a/picture2.drawio.svg +++ b/picture2.drawio.svg @@ -1,4 +1,4 @@ - + @@ -125,6 +125,22 @@ + + + + + + + 输出学生信息 + + + + + + 输出学生信息 + + + From 5e2a635e9edfb8dce80a03f3049979e5eef2dc61 Mon Sep 17 00:00:00 2001 From: deyuanw <@ bzu.edu.cn> Date: Tue, 25 Apr 2023 20:24:18 +0800 Subject: [PATCH 05/14] 2 --- picture3.drawio.svg | 102 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 picture3.drawio.svg diff --git a/picture3.drawio.svg b/picture3.drawio.svg new file mode 100644 index 0000000..93e63b8 --- /dev/null +++ b/picture3.drawio.svg @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + printf_data + + + + + + + + + + + + + + + printf_data... + + + + + + + + + + + + + 打印学生学号和姓名 + + + + + + 打印学生学号和姓名 + + + + + + + + + + + + + for(i=0;i<n;i++) + + n为学生数 + + + + + + for(i=0;i<n;i... + + + + + + + + + + + 打印学生成绩 + + + + + + 打印学生成绩 + + + + + + + + + Text is not SVG - cannot display + + + + \ No newline at end of file From ca39872d35247f9ff7bae0cb3280f2950d1f77a6 Mon Sep 17 00:00:00 2001 From: deyuanw <@ bzu.edu.cn> Date: Tue, 25 Apr 2023 20:41:25 +0800 Subject: [PATCH 06/14] 5 --- picture4.drawio.svg | 230 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 picture4.drawio.svg diff --git a/picture4.drawio.svg b/picture4.drawio.svg new file mode 100644 index 0000000..953d35f --- /dev/null +++ b/picture4.drawio.svg @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + sort_data + + + + + + + + + + + + + sort_data... + + + + + + + + + + + + + 将学号按照从小到大排序 + + + + + + 将学号按照从小到大排序 + + + + + + + + + + + + + 将学生成绩进行比较 + + + + + + 将学生成绩进行比较 + + + + + + + + + + + + + + + 前者大于后者 + + + + + + 前者大于后者 + + + + + + + + + + + + + 顺序交换 + + + + + + 顺序交换 + + + + + + + + + + + + + 按照学号进行排序 + + + + + + 按照学号进行排序 + + + + + + + + + + + 成绩相同 + + + + + + 成绩相同 + + + + + + + + + + + + + + 不交换 + + + + + + 不交换 + + + + + + + + + + + + 前者小于后者 + + + + + + 前者小于后者 + + + + + + + + + + + + + 直至不在交换 + + + + + + 直至不在交换 + + + + + + + + + + + + 输出最终成绩排序 + + + + + + 输出最终成绩排序 + + + + + + + + + Text is not SVG - cannot display + + + + \ No newline at end of file From dd4894542299b866a6701f303103cf62bf787be0 Mon Sep 17 00:00:00 2001 From: deyuanw <@ bzu.edu.cn> Date: Wed, 26 Apr 2023 17:53:21 +0800 Subject: [PATCH 07/14] 11111 --- picture2.drawio.svg => .drawio.svg | 0 picture1.drawio.svg => delete.drawio.svg | 0 picture3.drawio.svg => printf.drawio.svg | 0 picture.drawio.svg => query.drawio.svg | 0 picture4.drawio.svg => sort.drawio.svg | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename picture2.drawio.svg => .drawio.svg (100%) rename picture1.drawio.svg => delete.drawio.svg (100%) rename picture3.drawio.svg => printf.drawio.svg (100%) rename picture.drawio.svg => query.drawio.svg (100%) rename picture4.drawio.svg => sort.drawio.svg (100%) diff --git a/picture2.drawio.svg b/.drawio.svg similarity index 100% rename from picture2.drawio.svg rename to .drawio.svg diff --git a/picture1.drawio.svg b/delete.drawio.svg similarity index 100% rename from picture1.drawio.svg rename to delete.drawio.svg diff --git a/picture3.drawio.svg b/printf.drawio.svg similarity index 100% rename from picture3.drawio.svg rename to printf.drawio.svg diff --git a/picture.drawio.svg b/query.drawio.svg similarity index 100% rename from picture.drawio.svg rename to query.drawio.svg diff --git a/picture4.drawio.svg b/sort.drawio.svg similarity index 100% rename from picture4.drawio.svg rename to sort.drawio.svg From 43d87b23be915c49517a2976e0be0fe76432f103 Mon Sep 17 00:00:00 2001 From: deyuanw <@ bzu.edu.cn> Date: Wed, 26 Apr 2023 19:22:19 +0800 Subject: [PATCH 08/14] 3 --- daima | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/daima b/daima index e69de29..ed72c0e 100644 --- a/daima +++ b/daima @@ -0,0 +1,90 @@ +#define NAME_LEN 31 +#define MAX_PARTS 100 +//保存学生成绩信息的结构 +struct students +{ + int number; + char name[NAME_LEN + 1]; + int score; +}; +static struct students stu[MAX_PARTS]; +static int num_parts = 0; +#include +#include + +//定义常量 +#define CMD_QUIT 0 +#define CMD_QUERY 4 +#define CMD_INSERT 5 +#define CMD_UPDATE 6 +#define CMD_DELETE 7 +#define CMD_READ 1 +#define CMD_SAVE 2 +#define CMD_PRINT 3 +#define CMD_SORT 8 +#define CMD_CHART 9 +// 菜单命令的编号 + +// 函数声明 +void init(void); +void quit(void); +void display_menu(void); +int make_choice(void); +void read_data(void); // 读取 +void save_data(void); // 保存 +void print_data(void); // 打印 +void query_data(void); // 查询 +void add_data(void); // 添加 +void update_data(void); // 修改 +void delete_data(void); // 删除 +void sort_data(void); // 排序 +void make_chart(void); // 图表 +int confirm(const char *msg); + +// 主程序 +int main(void) +{ + init(); // 程序启动 + while (1) + { + display_menu(); + int c = make_choice(); + switch (c) + { + case CMD_QUERY: + query_data(); + break; + case CMD_INSERT: + add_data(); + break; + case CMD_UPDATE: + update_data(); + break; + case CMD_DELETE: + delete_data(); + break; + case CMD_READ: + read_data(); + break; + case CMD_SAVE: + save_data(); + break; + case CMD_PRINT: + print_data(); + break; + case CMD_SORT: + sort_data(); + break; + case CMD_CHART: + make_chart(); + break; + default: + puts("命令错误,请重新选择"); + break; + case CMD_QUIT: + if (confirm("确定要退出吗?")) + quit(); // 仅在确认后退出 + break; + } + } + return 0; \ No newline at end of file From a61df274f53446e6042610387afbb08a4089ceb5 Mon Sep 17 00:00:00 2001 From: deyuanw <@ bzu.edu.cn> Date: Wed, 26 Apr 2023 19:23:06 +0800 Subject: [PATCH 09/14] 5 --- .vscode/c_cpp_properties.json | 18 +++++++++++++++++ .vscode/launch.json | 24 ++++++++++++++++++++++ .vscode/settings.json | 38 +++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 .vscode/c_cpp_properties.json create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..5472856 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,18 @@ +{ + "configurations": [ + { + "name": "windows-gcc-x64", + "includePath": [ + "${workspaceFolder}/**" + ], + "compilerPath": "C:/mingw64/bin/gcc.exe", + "cStandard": "${default}", + "cppStandard": "${default}", + "intelliSenseMode": "windows-gcc-x64", + "compilerArgs": [ + "" + ] + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..3a83391 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,24 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "C/C++ Runner: Debug Session", + "type": "cppdbg", + "request": "launch", + "args": [], + "stopAtEntry": false, + "externalConsole": true, + "cwd": "c:/Users/王德沅/c/test1", + "program": "c:/Users/王德沅/c/test1/build/Debug/outDebug", + "MIMode": "gdb", + "miDebuggerPath": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..65c81b6 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,38 @@ +{ + "C_Cpp_Runner.cCompilerPath": "gcc", + "C_Cpp_Runner.cppCompilerPath": "g++", + "C_Cpp_Runner.debuggerPath": "gdb", + "C_Cpp_Runner.cStandard": "", + "C_Cpp_Runner.cppStandard": "", + "C_Cpp_Runner.msvcBatchPath": "", + "C_Cpp_Runner.useMsvc": false, + "C_Cpp_Runner.warnings": [ + "-Wall", + "-Wextra", + "-Wpedantic", + "-Wshadow", + "-Wformat=2", + "-Wconversion", + "-Wnull-dereference", + "-Wsign-conversion" + ], + "C_Cpp_Runner.enableWarnings": true, + "C_Cpp_Runner.warningsAsError": false, + "C_Cpp_Runner.compilerArgs": [], + "C_Cpp_Runner.linkerArgs": [], + "C_Cpp_Runner.includePaths": [], + "C_Cpp_Runner.includeSearch": [ + "*", + "**/*" + ], + "C_Cpp_Runner.excludeSearch": [ + "**/build", + "**/build/**", + "**/.*", + "**/.*/**", + "**/.vscode", + "**/.vscode/**" + ], + "C_Cpp_Runner.useAddressSanitizer": false, + "C_Cpp_Runner.showCompilationTime": false +} \ No newline at end of file From 1833b8adb28a6bc98fbf03450cc19c4ddd889609 Mon Sep 17 00:00:00 2001 From: pfehg54j3 <3123893053@qq.com> Date: Thu, 27 Apr 2023 22:05:16 +0800 Subject: [PATCH 10/14] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5f66912..3cb9f89 100644 --- a/README.md +++ b/README.md @@ -341,7 +341,7 @@ Step 2.4: if c == CMD_SAVE then 保存数据 Step 2.5: if c == CMD_PRINT then 打印数据 Step 2.6: -![主程序流程图](images/main.drawio.svg) +![picture-main.draw](/picture-main.drawio.svg) #### save_data @@ -351,7 +351,7 @@ Step 3: if 打开文件失败 then 提示打开文件失败并结束 Step 4: 将所有库存记录写入文件 Step 5: 关闭文件 -![保存数据流程图](images/save_data.drawio.svg) +![picture-save.draw](/picture-save.draw.svg) #### add_data @@ -362,7 +362,7 @@ Step 4: 输入零件名和库存数量 Step 5: 添加新零件到数据 Step 6: 提示添加成功 -![添加库存记录流程图](images/add_data.drawio.svg) +![picture-add.draw](/picture-add.drawio.svg) ### query_data @@ -372,7 +372,7 @@ Step 3:查询最后一个学生结束 Step 4:if未查询到提示学生不存在 Step 5:else打印学生信息 -![查询流程图](https://code.educoder.net/repo/p8rq79j4h/test1/raw/branch/master/picture.drawio.svg) +![picture.draw](/picture.drawio.svg) ### printf_data From df3d09266566d88d69224ce1445871c489b927d3 Mon Sep 17 00:00:00 2001 From: p8rq79j4h <799868457@qq.com> Date: Fri, 28 Apr 2023 17:19:03 +0800 Subject: [PATCH 12/14] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3cb9f89..af3a67c 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ | ------ | ------ | ------ | ------ | | 25 | 25 | 25 | 25 | ->>>>>>> ec05cf9b65bc3b08589f06d0cbdf8236edde96dd + >>>>>>> >>>>>> >>>>> From dd413e2f973620f935be743b0681fbcc1eb3105e Mon Sep 17 00:00:00 2001 From: wangkaixuan <@ bzu.edu.cn> Date: Fri, 28 Apr 2023 17:31:43 +0800 Subject: [PATCH 13/14] 1 --- daima | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daima b/daima index ed72c0e..96c5def 100644 --- a/daima +++ b/daima @@ -1,6 +1,6 @@ #define NAME_LEN 31 #define MAX_PARTS 100 -//保存学生成绩信息的结构 +/保存学生成绩信息的结构 struct students { int number; From 1092690b9c20d8270b8f7b4d259e3483d8b92f1c Mon Sep 17 00:00:00 2001 From: wangkaixuan <@ bzu.edu.cn> Date: Fri, 28 Apr 2023 17:38:55 +0800 Subject: [PATCH 14/14] 1 --- daima => daima1.c | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename daima => daima1.c (100%) diff --git a/daima b/daima1.c similarity index 100% rename from daima rename to daima1.c