From 85230b46350132d7f38c4cdcdc82cc3db420cdb7 Mon Sep 17 00:00:00 2001 From: deyuanw <@ bzu.edu.cn> Date: Mon, 24 Apr 2023 20:37:32 +0800 Subject: [PATCH 01/25] 567 --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index c79c801..72b289b 100644 --- a/README.md +++ b/README.md @@ -405,3 +405,15 @@ Step 4:否则提示不存在并结束 ### sort_data Step 1:对库存记录按学号从小到大排序 + + + +### make_chart + +Step 1:输入文件名 +Step 2:判断其是否存在 +Step 3:若存在则打开文件并读取CSV 格式保存的所有库存记录 +Step 4:否则给出错误信息并结束 + + + -- 2.34.1 From 556aee82dda5dbc3569c30406b2896ee160e4d46 Mon Sep 17 00:00:00 2001 From: wangkaixuan <@ bzu.edu.cn> Date: Mon, 24 Apr 2023 20:46:28 +0800 Subject: [PATCH 02/25] 1 --- picture.drawio.svg | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/picture.drawio.svg b/picture.drawio.svg index 59e1648..56f5d2c 100644 --- a/picture.drawio.svg +++ b/picture.drawio.svg @@ -1,4 +1,4 @@ - + @@ -119,6 +119,24 @@ + + + +
+
+
+

+ 结束 +

+
+
+
+
+ + 结束 + +
+
-- 2.34.1 From 3c892ca9ef3909e0a960b96212b96c4c121a07cb Mon Sep 17 00:00:00 2001 From: deyuanw <@ bzu.edu.cn> Date: Mon, 24 Apr 2023 21:42:25 +0800 Subject: [PATCH 03/25] 123 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 72b289b..542ef36 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,9 @@ | C4 添加库存记录 | 王凯旋 | 王德沅 | 冯国平 | 苏永涛 | | C5查询库存记录 | 冯国平 | 王德沅 | 苏永涛 | 王凯旋 | | C6打印库存列表 | 王德沅 | 苏永涛 | 冯国平 | 王凯旋 | -| C7修改库存记录 | 苏永涛 | 王凯旋 | 王凯旋 | 冯国平 | +| C7修改库存记录 | 苏永涛 | 王德沅 | 王凯旋 | 冯国平 | | C8删除库存记录 | 冯国平 | 王凯旋 | 苏永涛 | 王德沅 | -| C9库存记录排序 | 王德沅 | 苏永涛 | 王凯旋 | 苏永涛 | +| C9库存记录排序 | 王德沅 | 冯国平 | 王凯旋 | 苏永涛 | | C10从文件中读取库存记录 | 王凯旋 | 苏永涛 | 冯国平 | 王德沅 | | C11从库存保存到文件 | 苏永涛 | 王德沅 | 王凯旋 | 冯国平 | | C12以图标方式显示库存记录 | 冯国平 | 苏永涛 | 王德沅 | 王凯旋 | -- 2.34.1 From ba17e90fab0b98b2a24e4850db01b3125ab28907 Mon Sep 17 00:00:00 2001 From: wangkaixuan <@ bzu.edu.cn> Date: Tue, 25 Apr 2023 19:32:39 +0800 Subject: [PATCH 04/25] 1 --- README.md | 16 ++ picture1.drawio.svg | 521 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 537 insertions(+) create mode 100644 picture1.drawio.svg diff --git a/README.md b/README.md index 542ef36..8e5fc25 100644 --- a/README.md +++ b/README.md @@ -405,7 +405,13 @@ Step 4:否则提示不存在并结束 ### sort_data Step 1:对库存记录按学号从小到大排序 +<<<<<<< HEAD +======= +Step 2:将按照学生成绩排序,若前面的比后面大,则交换 +Step 3:每次遍历记录是否交换,若没有交换,则排序结束 +Step 4:若成绩相同,则按照学号从小到大排序 +>>>>>>> 8892531498f3879c5e2a02c0346d2e14e7d0d0ff ### make_chart @@ -416,4 +422,14 @@ Step 3:若存在则打开文件并读取CSV 格式保存的所有库存记录 Step 4:否则给出错误信息并结束 +<<<<<<< HEAD +======= +### read_data +Step 1:输入文件名 +Step 2:查看输入的文件名是否和已有的文化相匹配 +Step 3:若匹配成功,则打开文件 +Step 4:若不成功,则返回错误值 +Step 5:打开后利用循环,依次输出文件里各个学生的学号,姓名和成绩; +Step 6:关闭文件 +>>>>>>> 8892531498f3879c5e2a02c0346d2e14e7d0d0ff diff --git a/picture1.drawio.svg b/picture1.drawio.svg new file mode 100644 index 0000000..e6b1f6e --- /dev/null +++ b/picture1.drawio.svg @@ -0,0 +1,521 @@ + + + + + + + + + +
+
+
+ + main + +
+
+
+
+ + main + +
+
+ + + + + + +
+
+
+ init +
+
+
+
+ + init + +
+
+ + + + + + +
+
+
+ 显示菜单 +
+
+
+
+ + 显示菜单 + +
+
+ + + + + + +
+
+
+ 选择菜单命令 +
+
+
+
+ + 选择菜单命令 + +
+
+ + + + + + + + +
+
+
+ 读取数据 +
+
+
+
+ + 读取数据 + +
+
+ + + + + + + + +
+
+
+ 保存数据 +
+
+
+
+ + 保存数据 + +
+
+ + + + + + + + +
+
+
+ 打印数据 +
+
+
+
+ + 打印数据 + +
+
+ + + + + + + + +
+
+
+ 查询数据 +
+
+
+
+ + 查询数据 + +
+
+ + + + + + + + +
+
+
+ 添加数据 +
+
+
+
+ + 添加数据 + +
+
+ + + + + + + + +
+
+
+ 更新数据 +
+
+
+
+ + 更新数据 + +
+
+ + + + + + + + +
+
+
+ 删除数据 +
+
+
+
+ + 删除数据 + +
+
+ + + + + + + + +
+
+
+ 对数据排序 +
+
+
+
+ + 对数据排序 + +
+
+ + + + + + + + + + +
+
+
+ 生成图表报表 +
+
+
+
+ + 生成图表报表 + +
+
+ + + + + + + + +
+
+
+ 确定退出 +
+
+
+
+ + 确定退出 + +
+
+ + + + + + + +
+
+
+ read_data +
+
+
+
+ + read_data + +
+
+ + + + + + + +
+
+
+ save_data +
+
+
+
+ + save_data + +
+
+ + + + + + + +
+
+
+ print_data +
+
+
+
+ + print_data + +
+
+ + + + + + + +
+
+
+ query_data +
+
+
+
+ + query_data + +
+
+ + + + + + + +
+
+
+ add_data +
+
+
+
+ + add_data + +
+
+ + + + + + + +
+
+
+ update_data +
+
+
+
+ + update_data + +
+
+ + + + + + + +
+
+
+ delete_data +
+
+
+
+ + delete_data + +
+
+ + + + + + + +
+
+
+ sort_data +
+
+
+
+ + sort_data + +
+
+ + + + + + + +
+
+
+ make_data +
+
+
+
+ + make_data + +
+
+ + + + + +
+
+
+ quit +
+
+
+
+ + quit + +
+
+ + + + + + + +
+
+
+ 命令错误,重新选择 +
+
+
+
+ + 命令错误,重新选择 + +
+
+
+ + + + + Text is not SVG - cannot display + + + +
\ No newline at end of file -- 2.34.1 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 05/25] 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 -- 2.34.1 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 06/25] 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 -- 2.34.1 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 07/25] 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 -- 2.34.1 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 08/25] 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 @@
+ + + +
+
+
+ 输出学生信息 +
+
+
+
+ + 输出学生信息 + +
+
-- 2.34.1 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 09/25] 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 -- 2.34.1 From f66267fa7b53bc47b11b094cfa04b245ef560e88 Mon Sep 17 00:00:00 2001 From: wangkaixuan <@ bzu.edu.cn> Date: Tue, 25 Apr 2023 20:32:15 +0800 Subject: [PATCH 10/25] 1 --- picture2.drawio.svg | 142 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 picture2.drawio.svg diff --git a/picture2.drawio.svg b/picture2.drawio.svg new file mode 100644 index 0000000..3a39675 --- /dev/null +++ b/picture2.drawio.svg @@ -0,0 +1,142 @@ + + + + + + + +
+
+
+ make_chart +
+
+
+
+ + make_chart + +
+
+ + + + + + +
+
+
+ 输入文件名 +
+
+
+
+ + 输入文件名 + +
+
+ + + + + +
+
+
+ 文件存在 +
+
+
+
+ + 文件存在 + +
+
+ + + + + +
+
+
+ yes +
+
+
+
+ + yes + +
+
+ + + + + + +
+
+
+ 打开文件并读取库存记录 +
+
+
+
+ + 打开文件并读取库存记录 + +
+
+ + + + +
+
+
+ else +
+
+
+
+ + else + +
+
+ + + + + +
+
+
+ 显示错误信息 +
+
+
+
+ + 显示错误信息 + +
+
+ + + +
+ + + + + Text is not SVG - cannot display + + + +
\ No newline at end of file -- 2.34.1 From 4adf578a44f4723d8718da4f441b5737cd12a5ff Mon Sep 17 00:00:00 2001 From: p8rq79j4h <799868457@qq.com> Date: Tue, 25 Apr 2023 20:35:50 +0800 Subject: [PATCH 11/25] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8e5fc25..f62d5fe 100644 --- a/README.md +++ b/README.md @@ -427,7 +427,7 @@ Step 4:否则给出错误信息并结束 ======= ### read_data Step 1:输入文件名 -Step 2:查看输入的文件名是否和已有的文化相匹配 +Step 2:查看输入的文件名是否和已有的文件相匹配 Step 3:若匹配成功,则打开文件 Step 4:若不成功,则返回错误值 Step 5:打开后利用循环,依次输出文件里各个学生的学号,姓名和成绩; -- 2.34.1 From ca4444aa66217bd150c2416d3a60d3e90a18da0a Mon Sep 17 00:00:00 2001 From: wangkaixuan <@ bzu.edu.cn> Date: Tue, 25 Apr 2023 20:39:49 +0800 Subject: [PATCH 12/25] 1 --- picture3.drawio.svg | 143 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 picture3.drawio.svg diff --git a/picture3.drawio.svg b/picture3.drawio.svg new file mode 100644 index 0000000..7f4ac0b --- /dev/null +++ b/picture3.drawio.svg @@ -0,0 +1,143 @@ + + + + + + + +
+
+
+ read_data +
+
+
+
+ + read_data + +
+
+ + + + + + +
+
+
+ 输入文件名 +
+
+
+
+ + 输入文件名 + +
+
+ + + + + +
+
+
+ 输入文件与已有文件匹配 +
+
+
+
+ + 输入文件与已有文件匹配 + +
+
+ + + + + +
+
+
+ yes +
+
+
+
+
+ + yes + +
+
+ + + + + +
+
+
+ 打开文件 +
+
+
+
+ + 打开文件 + +
+
+ + + + + +
+
+
+ no +
+
+
+
+ + no + +
+
+ + + + + +
+
+
+ 显示错误值 +
+
+
+
+ + 显示错误值 + +
+
+ + + +
+ + + + + Text is not SVG - cannot display + + + +
\ No newline at end of file -- 2.34.1 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 13/25] 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 -- 2.34.1 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 14/25] 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 -- 2.34.1 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 15/25] 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 -- 2.34.1 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 16/25] 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 -- 2.34.1 From ea399bbd8cc8fb337ad8de9ea0be085321ae96c9 Mon Sep 17 00:00:00 2001 From: wangkaixuan <@ bzu.edu.cn> Date: Wed, 26 Apr 2023 19:36:32 +0800 Subject: [PATCH 17/25] 1 --- daima | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/daima b/daima index e69de29..d437315 100644 --- a/daima +++ b/daima @@ -0,0 +1,90 @@ +} + +// 函数定义 +void init(void) +{ + puts("程序启动"); +} +void quit(void) +{ + puts("程序退出"); + exit(EXIT_SUCCESS); +} +void display_menu(void) +{ + printf("\n%d 读取 | %d 保存 | %d 打印 | %d 查询 | %d 添加\n%d 修改 | %d 删除 | %d 排序 | %d 图表 | %d 退出\n\n", CMD_READ, CMD_SAVE, CMD_PRINT, CMD_QUERY, CMD_INSERT, CMD_UPDATE, CMD_DELETE, CMD_SORT, CMD_CHART, CMD_QUIT); +} +int make_choice(void) +{ + int c; // 用户输入 + int n = 0; // 正确读入的数据项个数 + while (n == 0) + { + printf("请选择:"); + n = scanf("%d", &c); // 尝试读入整数 c + scanf("%*[^\n]"); // 跳过一行中剩余的字符 + } + return c; +} + +//查询 +void query_data(void) +{ + int num; + printf("输入学生学号: "); + scanf("%d", &num); + int f = -1; + for (int i = 0; i < num_parts; i++) + { + if (num == stu[i].number) + { + f = i; + break; + } + } + if (f == -1) + { + printf("学生不存在"); + } + else + { + printf("学生学号:%d\n", stu[f].number); + printf("学生姓名:%s\n", stu[f].name); + printf("学生成绩:%d\n", stu[f].score); + } +} + +//打印 +void print_data(void) +{ + printf("NUMBER | NAME score\n"); + for (int i = 0; i < num_parts; i++) + { + printf("%d | %s %d\n", stu[i].number, stu[i].name, stu[i].score); + } +} + +//添加 +void add_data(void) +{ + int num; + printf("输入学生学号:"); + scanf("%d", &num); + int f = 0; + for (int i = 0; i < num_parts; i++) + { + if (num == stu[i].number) + { + f = 1; + break; + } + } + if (f == 0) + { + stu[num_parts].number = num; + printf("输入学生姓名:"); + scanf("%s", &stu[num_parts].name); + printf("输入学生成绩:"); + scanf("%d", &stu[num_parts].score); + num_parts++; + printf("学生 %d 添加成功\n", num); \ No newline at end of file -- 2.34.1 From 7b98d2b4ad0c25c5d6c7a812154348224160a1c8 Mon Sep 17 00:00:00 2001 From: wangkaixuan <@ bzu.edu.cn> Date: Thu, 27 Apr 2023 19:05:52 +0800 Subject: [PATCH 18/25] 1 --- main.drawio.svg | 521 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 521 insertions(+) create mode 100644 main.drawio.svg diff --git a/main.drawio.svg b/main.drawio.svg new file mode 100644 index 0000000..a21fedf --- /dev/null +++ b/main.drawio.svg @@ -0,0 +1,521 @@ + + + + + + + + + +
+
+
+ + main + +
+
+
+
+ + main + +
+
+ + + + + + +
+
+
+ init +
+
+
+
+ + init + +
+
+ + + + + + +
+
+
+ 显示菜单 +
+
+
+
+ + 显示菜单 + +
+
+ + + + + + +
+
+
+ 选择菜单命令 +
+
+
+
+ + 选择菜单命令 + +
+
+ + + + + + + + +
+
+
+ 读取数据 +
+
+
+
+ + 读取数据 + +
+
+ + + + + + + + +
+
+
+ 保存数据 +
+
+
+
+ + 保存数据 + +
+
+ + + + + + + + +
+
+
+ 打印数据 +
+
+
+
+ + 打印数据 + +
+
+ + + + + + + + +
+
+
+ 查询数据 +
+
+
+
+ + 查询数据 + +
+
+ + + + + + + + +
+
+
+ 添加数据 +
+
+
+
+ + 添加数据 + +
+
+ + + + + + + + +
+
+
+ 更新数据 +
+
+
+
+ + 更新数据 + +
+
+ + + + + + + + +
+
+
+ 删除数据 +
+
+
+
+ + 删除数据 + +
+
+ + + + + + + + +
+
+
+ 对数据排序 +
+
+
+
+ + 对数据排序 + +
+
+ + + + + + + + + + +
+
+
+ 生成图表报表 +
+
+
+
+ + 生成图表报表 + +
+
+ + + + + + + + +
+
+
+ 确定退出 +
+
+
+
+ + 确定退出 + +
+
+ + + + + + + +
+
+
+ read_data +
+
+
+
+ + read_data + +
+
+ + + + + + + +
+
+
+ save_data +
+
+
+
+ + save_data + +
+
+ + + + + + + +
+
+
+ print_data +
+
+
+
+ + print_data + +
+
+ + + + + + + +
+
+
+ query_data +
+
+
+
+ + query_data + +
+
+ + + + + + + +
+
+
+ add_data +
+
+
+
+ + add_data + +
+
+ + + + + + + +
+
+
+ update_data +
+
+
+
+ + update_data + +
+
+ + + + + + + +
+
+
+ delete_data +
+
+
+
+ + delete_data + +
+
+ + + + + + + +
+
+
+ sort_data +
+
+
+
+ + sort_data + +
+
+ + + + + + + +
+
+
+ make_data +
+
+
+
+ + make_data + +
+
+ + + + + +
+
+
+ quit +
+
+
+
+ + quit + +
+
+ + + + + + + +
+
+
+ 命令错误,重新选择 +
+
+
+
+ + 命令错误,重新选择 + +
+
+
+ + + + + Text is not SVG - cannot display + + + +
\ No newline at end of file -- 2.34.1 From f32e3d333ab59fe4efce7a4d1568661dac8d485e Mon Sep 17 00:00:00 2001 From: wangkaixuan <@ bzu.edu.cn> Date: Thu, 27 Apr 2023 19:06:02 +0800 Subject: [PATCH 19/25] 1 --- picture2.drawio.svg => make_chart.drawio.svg | 0 picture1.drawio.svg | 521 ------------------- picture.drawio.svg => qyery_data.drawio.svg | 0 picture3.drawio.svg => read_data.drawio.svg | 0 4 files changed, 521 deletions(-) rename picture2.drawio.svg => make_chart.drawio.svg (100%) delete mode 100644 picture1.drawio.svg rename picture.drawio.svg => qyery_data.drawio.svg (100%) rename picture3.drawio.svg => read_data.drawio.svg (100%) diff --git a/picture2.drawio.svg b/make_chart.drawio.svg similarity index 100% rename from picture2.drawio.svg rename to make_chart.drawio.svg diff --git a/picture1.drawio.svg b/picture1.drawio.svg deleted file mode 100644 index e6b1f6e..0000000 --- a/picture1.drawio.svg +++ /dev/null @@ -1,521 +0,0 @@ - - - - - - - - - -
-
-
- - main - -
-
-
-
- - main - -
-
- - - - - - -
-
-
- init -
-
-
-
- - init - -
-
- - - - - - -
-
-
- 显示菜单 -
-
-
-
- - 显示菜单 - -
-
- - - - - - -
-
-
- 选择菜单命令 -
-
-
-
- - 选择菜单命令 - -
-
- - - - - - - - -
-
-
- 读取数据 -
-
-
-
- - 读取数据 - -
-
- - - - - - - - -
-
-
- 保存数据 -
-
-
-
- - 保存数据 - -
-
- - - - - - - - -
-
-
- 打印数据 -
-
-
-
- - 打印数据 - -
-
- - - - - - - - -
-
-
- 查询数据 -
-
-
-
- - 查询数据 - -
-
- - - - - - - - -
-
-
- 添加数据 -
-
-
-
- - 添加数据 - -
-
- - - - - - - - -
-
-
- 更新数据 -
-
-
-
- - 更新数据 - -
-
- - - - - - - - -
-
-
- 删除数据 -
-
-
-
- - 删除数据 - -
-
- - - - - - - - -
-
-
- 对数据排序 -
-
-
-
- - 对数据排序 - -
-
- - - - - - - - - - -
-
-
- 生成图表报表 -
-
-
-
- - 生成图表报表 - -
-
- - - - - - - - -
-
-
- 确定退出 -
-
-
-
- - 确定退出 - -
-
- - - - - - - -
-
-
- read_data -
-
-
-
- - read_data - -
-
- - - - - - - -
-
-
- save_data -
-
-
-
- - save_data - -
-
- - - - - - - -
-
-
- print_data -
-
-
-
- - print_data - -
-
- - - - - - - -
-
-
- query_data -
-
-
-
- - query_data - -
-
- - - - - - - -
-
-
- add_data -
-
-
-
- - add_data - -
-
- - - - - - - -
-
-
- update_data -
-
-
-
- - update_data - -
-
- - - - - - - -
-
-
- delete_data -
-
-
-
- - delete_data - -
-
- - - - - - - -
-
-
- sort_data -
-
-
-
- - sort_data - -
-
- - - - - - - -
-
-
- make_data -
-
-
-
- - make_data - -
-
- - - - - -
-
-
- quit -
-
-
-
- - quit - -
-
- - - - - - - -
-
-
- 命令错误,重新选择 -
-
-
-
- - 命令错误,重新选择 - -
-
-
- - - - - Text is not SVG - cannot display - - - -
\ No newline at end of file diff --git a/picture.drawio.svg b/qyery_data.drawio.svg similarity index 100% rename from picture.drawio.svg rename to qyery_data.drawio.svg diff --git a/picture3.drawio.svg b/read_data.drawio.svg similarity index 100% rename from picture3.drawio.svg rename to read_data.drawio.svg -- 2.34.1 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 20/25] 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 -- 2.34.1 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 22/25] 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 + >>>>>>> >>>>>> >>>>> -- 2.34.1 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 23/25] 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; -- 2.34.1 From 969a0d9599abee6d48cbe278b9a54d3ae7b3f015 Mon Sep 17 00:00:00 2001 From: wangkaixuan <@ bzu.edu.cn> Date: Fri, 28 Apr 2023 17:36:34 +0800 Subject: [PATCH 24/25] 1 --- daima | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daima b/daima index d437315..4d0fb6b 100644 --- a/daima +++ b/daima @@ -1,6 +1,6 @@ } -// 函数定义 +/ 函数定义 void init(void) { puts("程序启动"); -- 2.34.1 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 25/25] 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 -- 2.34.1