Compare commits

..

30 Commits

Author SHA1 Message Date
pi9jl6p58 f48414b6a3 Update README.md
2 years ago
刘梦琦 d5e63262c0 123
2 years ago
刘梦琦 15a2be305b 1234
2 years ago
pi9jl6p58 0ed6d1c6c0 Update README.md
2 years ago
c29909f21f 替换
2 years ago
e21e8d5283 111111111111
2 years ago
c951c61562 111111
2 years ago
马誉航 f99db1e159 Merge branch 'master' of https://bdgit.educoder.net/pe3l754au/C1
2 years ago
马誉航 0714c3a537 学生成绩管理系统.cc
2 years ago
王意伟 e4cb08cfcf .
2 years ago
刘梦琦 4d97c78364 1234
2 years ago
刘梦琦 d42566dd1a 1234
2 years ago
刘梦琦 6312f69cfb 123
2 years ago
刘梦琦 4f4bf67447 123
2 years ago
刘梦琦 0407ff2857 Merge branch 'master' of https://bdgit.educoder.net/pe3l754au/C1
2 years ago
刘梦琦 64f7a73721 123
2 years ago
王意伟 0f1edc53f7 .
2 years ago
pe3l754au f02d51bb94 Merge pull request 'qiuqiuleheqilai' (#5) from 分1 into master
2 years ago
刘梦琦 09d6eecc44 Merge branch 'master' of https://bdgit.educoder.net/pe3l754au/C1
2 years ago
刘梦琦 072b1db89a 123
2 years ago
王意伟 019357e169 .
2 years ago
pe3l754au 3b0e07bc8f Merge pull request 'fenzhiW' (#4) from 分1 into master
2 years ago
pe3l754au 22f775a7f0 Merge pull request '1233467765' (#3) from liuxincheng into master
2 years ago
王意伟 e159fc70a9 .
2 years ago
pe3l754au 4ee515e0b0 Merge pull request '表格' (#2) from liuxincheng into master
2 years ago
pe3l754au da4f551e38 Merge pull request '.' (#1) from 分1 into master
2 years ago
王意伟 0cccc8854b .
2 years ago
刘梦琦 2b4da29cd3 Merge branch 'master' of https://bdgit.educoder.net/pe3l754au/C1
2 years ago
刘梦琦 841af5fe17 1234
2 years ago
王意伟 03d44f30a3 .
2 years ago

@ -4,7 +4,7 @@
## 项目简介
本学生成绩管理系统是为教师提供管理班级成绩的工具,该系统可以实现的对学生的成绩进行增、删、改、查、信息保存和信息导入等基本功能,以及对学生成绩排序和分段的扩展功能,有利于对学生成绩管理。
下载地址https://bdgit.educoder.net/pe3l754au/C.git
下载地址https://bdgit.educoder.net/pe3l754au/C1.git
项目开发过程中采用 Kanban看板进行任务管理和分工协作并使用 Git 对程序代码和文档进行版
本管理。任务分工情况如下:
```
@ -238,4 +238,86 @@ a: No such file or directory
数据query_data、添加数据add_data、更新数据update_data、删除数据
delete_data、数据排序sort_data和生成图表make_chart等子模块。其中查询、添加、更
新和删除数据还会用到根据编号查询数据的方法find
上述各模块通过主程序main进行调用系统模块图如下。
![](main.svg)
各模块的主要功能如下:
### main
系统主函数模块,显示菜单,根据用户选择的菜单命令,执行相关操作。
### init
系统初始化。
### display_menu
显示菜单命令。
## 详细设计
针对概要设计
### main
```
Step 1: 初始化
Step 2: 根据用户选择的命令执行对应的操作
Step 2.1: 显示菜单
Step 2.2: 选择菜单命令 c
Step 2.3: if c == CMD_READ then 读取数据
Step 2.4: if c == CMD_SAVE then 保存数据
Step 2.5: if c == CMD_PRINT then 打印数据
Step 2.6:
```
![](main.svg)
### save_data
```
Step 1: 输入文件名
Step 2: 打开文件
Step 3: if 打开文件失败 then 提示打开文件失败并结束
Step 4: 将所有库存记录写入文件
Step 5: 关闭文件
```
![](save_data.svg)
### print_data
```
Step 1: for 0 to num_part-1
Step 2: 打印学生成绩
```
![](print_data.svg)
### query_data
```
Step 1: for 0 to num_part-1 查询
Step 2: 输入查询学号
Step 3: 根据查询结果输出
```
![](query_data.svg)
### add_data
```
Step 1: for 0 to num_part-1 添加
Step 2: 输入添加学号
Step 3: if 成立则结束 else 输入学生名称、名次,添加分数, 并提示完成
```
![](add_data.svg)
### update_data
```
Step 1: for 0 to num_part-1 修改
Step 2: 输入修改学号
Step 3: if 不成立则结束 else 输出学生信息
```
![](update_data.svg)
### delete_data
```
Step 1: for 0 to num_part-1 删除
Step 2: 输入删除学号
Step 3: if 不成立则结束 else 删除
```
![](delete_data.svg)
### sort_data
```
Step 1: for 0 to num_part-1 排序
Step 2: 按学生学号从小到大排序
```
![](sort_data.svg)
### make_chart
```
Step 1: Step 1: for 0 to num_part-1 图表
Step 2: 以图表方式显示库存记录
```
![](make_chart.svg)
名字:刘梦琦
总结:通过这次的实验项目,我深刻体会到团队合作的意义,每个人都有自己要完成的任务,在遇到问题时需要队员间的相互帮助。首先,分配好每个人的任务,其次,在最初开始任务时,我们都比较手足无措,都有对任务的疑问和困惑,通过讨论怎样去做、怎样完成任务进而解决问题,我们对学生系统要实现的功能有了一定了解后,按照模板进行项目推进,最后,每个人都完成了画图和实现部分项目功能的任务。虽然我是项目组长,但是有很多不足和需要改进的地方,遇到问题时在队员的帮助之下完成了相应的任务。一个项目的完成离不开一个团队的团结协作,在进行项目时,需要反复的纠错和改进,从而不断地提升自我。这一次很好的团队体验,让我能够初步地体会到一个团队间的分工协作的重要性,在以后的工作中,必然少不了团队合作,这次项目的完成为以后打下了基础,如果我们再遇到项目时,我们能够较好地知道怎样完成项目。
名字:刘鑫成
总结:本次的程序设计活动,让我体验到了公司实际开发项目中的紧张感,以及程序开发成功的自豪感,一个项目的完成离不开一个团队的团结协作,在进行项目时,需要对其进行反复的纠错和改进,在更改和发现中不断地改进和提升自,从而丰富自己。这次团队体验,让我能够初步地体会到一个团队间的分工协作的重要性,成员分工以及项目领导者的重要性,让我受益匪浅

@ -0,0 +1,180 @@
<svg host="65bd71144e" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="386px" height="731px" viewBox="-0.5 -0.5 386 731" content="&lt;mxfile&gt;&lt;diagram id=&quot;5r2FhZIOgLJSjUQlOUcC&quot; name=&quot;Page-1&quot;&gt;5VhLc9sgEP41XDN6IaOj5Ed6aDuZyaHNqUMtYtEi48E4tvPrCxKyhFAaT+PIk+lJ7LKsdj99LKxAOC0PtwJvii88JwwEXn4A4QwEge9NAvXQmmOtgTGqFStBc2PUKu7pM2lWGu2O5mRrGUrOmaQbW7nk6zVZSkuHheB72+yRM/utG7wijuJ+iZmr/UZzWdRaBL1W/4nQVdG82ffMTIkbY6PYFjjn+44qnINwKjiX9ag8TAnT4DW41OsWL8yeAhNkLc9ZENULnjDbmdxMXPLYJEtylbsR13ytHlkhS6YkXw3dF5oYtnwnlsaFcSqxWBFjFdYq7byzzAR5S3hJpDgqA0EYlvTJBh6b77c62bUpqoHJcjjjwMlYsZNI8iPHErvJM6ZIpXPeF1SS+w2uctorXp+JwxMRkhz+mmMzGxtSmF0RREbetxzzG+IUHX4h7+2w+PEoTAhdJvjwWlQI3ZTnCGRzkIRgDgGCIIV6kM5AGleaBcgmDizjMyPyz2RGfAlmoFGY0dDAosbkalXCe2vSKldx/K4ErxEetHADG3F26E7Ojkb6d7CSa4HVRGNtJGfb1JoE6UEyBSkC4cLBVBS8/LnbjlNvQ2jtKjhUbyfvVG+DkXbVxCVKcLVd1UTzClEikCGAZgOM6SOkrk8bPVQoYMYI4yuBS4XNhgiqoiOiP3fXTrzGsEd6IM3d81KMi2zGTYbqOHynOh4M7NL3YFwywLjoaoxLBhmHEEg9ME9AkoA06nBwApIIJIuKgwuQ+mAeA+SD1K1UH4x6kWdfISAc8QpxCrf9Cg8OoCoRacOAGV2t1Xip0q5g0+lS1YalZqKkea6XZ4Js6TP+WbnSh+iG07WsAoYZgDPtayf5tkV0KwX/TaaccdFS/ZEy1lNdAPkQ9pAfOGbCAeDDSwDvdjtf/xvgfWQDH48J/EBjraqMOt2yQNeUJANZVA1ikHnOJ/ngxSVOxiwuQ5cKhXNWtXEK4Zku6M5JN2pjbx/7aAge/70umgMn4BnHPhey4Cu+xuwz5xuDxS8i5dFQR+/rXsdzoLJqeG6iEBlZ9zz+jQeN2PY8Wjh2hA6Bz2+Dzr5XdIFuuHr2XcO4u9OlrcP5yOY88nsfqw7UrAo6v+B6jk69ZuOovynqm5TjKBUCHztmpvS+HDAM7ff0fw2+Zh9b9mpQR9Cy8AT4EDGV2P7WrM3bn8Ph/A8=&lt;/diagram&gt;&lt;/mxfile&gt;">
<defs/>
<g>
<path d="M 85 80 L 85 163.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 85 168.88 L 81.5 161.88 L 85 163.63 L 88.5 161.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<ellipse cx="85" cy="40" rx="60" ry="40" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 40px; margin-left: 26px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
delete_data
</div>
</div>
</div>
</foreignObject>
<text x="85" y="44" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
delete_data
</text>
</switch>
</g>
<path d="M 85 230 L 85 293.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 85 298.88 L 81.5 291.88 L 85 293.63 L 88.5 291.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<rect x="25" y="170" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 200px; margin-left: 26px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
输入学号
</div>
</div>
</div>
</foreignObject>
<text x="85" y="204" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
输入学号
</text>
</switch>
</g>
<path d="M 85 380 L 85 463.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 85 468.88 L 81.5 461.88 L 85 463.63 L 88.5 461.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<path d="M 170 340 L 268.63 340" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 273.88 340 L 266.88 343.5 L 268.63 340 L 266.88 336.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<path d="M 85 300 L 170 340 L 85 380 L 0 340 Z" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 168px; height: 1px; padding-top: 340px; margin-left: 1px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
学号存在?
</div>
</div>
</div>
</foreignObject>
<text x="85" y="344" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
学号存在?
</text>
</switch>
</g>
<path d="M 85 530 L 85 643.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 85 648.88 L 81.5 641.88 L 85 643.63 L 88.5 641.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<path d="M 10 530 L 30 470 L 160 470 L 140 530 Z" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 148px; height: 1px; padding-top: 500px; margin-left: 11px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
学号不存在
</div>
</div>
</div>
</foreignObject>
<text x="85" y="504" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
学号不存在
</text>
</switch>
</g>
<path d="M 325 370 L 325 443.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 325 448.88 L 321.5 441.88 L 325 443.63 L 328.5 441.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<path d="M 265 370 L 285 310 L 385 310 L 365 370 Z" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 340px; margin-left: 266px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
删除学生信息
</div>
</div>
</div>
</foreignObject>
<text x="325" y="344" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
删除学生信息
</text>
</switch>
</g>
<rect x="215" y="300" width="30" height="30" fill="none" stroke="none" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 315px; margin-left: 230px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;">
Y
</div>
</div>
</div>
</foreignObject>
<text x="230" y="319" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
Y
</text>
</switch>
</g>
<rect x="45" y="400" width="30" height="30" fill="none" stroke="none" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 415px; margin-left: 60px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: nowrap;">
N
</div>
</div>
</div>
</foreignObject>
<text x="60" y="419" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
N
</text>
</switch>
</g>
<path d="M 265 510 L 285 450 L 385 450 L 365 510 Z" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 480px; margin-left: 266px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
已更新
</div>
</div>
</div>
</foreignObject>
<text x="325" y="484" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
已更新
</text>
</switch>
</g>
<ellipse cx="85" cy="690" rx="55" ry="40" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 108px; height: 1px; padding-top: 690px; margin-left: 31px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
结束
</div>
</div>
</div>
</foreignObject>
<text x="85" y="694" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
结束
</text>
</switch>
</g>
<path d="M 317.56 513 L 317.93 570 Q 318 580 318 590 L 318 610 Q 318 620 308 620 L 91.37 620" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 86.12 620 L 93.12 616.5 L 91.37 620 L 93.12 623.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
</g>
<switch>
<g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/>
<a transform="translate(0,-5)" xlink:href="https://www.diagrams.net/doc/faq/svg-export-text-problems" target="_blank">
<text text-anchor="middle" font-size="10px" x="50%" y="100%">
Text is not SVG - cannot display
</text>
</a>
</switch>
</svg>

After

Width:  |  Height:  |  Size: 16 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

@ -0,0 +1,87 @@
<svg host="65bd71144e" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="121px" height="521px" viewBox="-0.5 -0.5 121 521" content="&lt;mxfile&gt;&lt;diagram id=&quot;wYNt-B6SHHeMAj8eh-_U&quot; name=&quot;Page-1&quot;&gt;3ZbNbqMwFIWfxnvA/GUZUtJuRhopiy4rC27AGoOR4wTSp+8lmBDG6UylmSZVN2AfX2Ofw4cFoauqe1SsKX/IHATxnLwj9IF4nu+FeO2F4yAEdDEIheL5ILmTsOGvYETHqHuew25WqKUUmjdzMZN1DZmeaUwp2c7LtlLMV21YAZawyZiw1Wee63JQ48CZ9CfgRTmu7DpmpGJjsRF2JctleyHRlNCVklIPrapbgeizG3MZ5q3fGT1vTEGtPzLBHyYcmNgbb2Zf+jiahRy9m24ta7wlpa4E9lxsDuV9zbs7MNJO7lVmqswqmqkCTBU9u0dqQFag1RFLFAim+WH+dGbeX3Gumyxiw7i87tizHFfsF7xkJVPa9i4EMtVbbkuuYdOwk4MWqb4WwwGUhu7PQdgWxwmhYcJ8FJ5v+u2EmDtyU17gFTv/nkp4Hw6ozUFwIw6o7TiNyXJNkoSkAYnXZBGSNOyvcURSv9eT0EoFP+Cmb6JRJgQIWShWYR4NKI57AvX72M9p4G9QbXkH4+n3SZD57gchC/8DZPF9IAtsyKIbQRZcgQyRikmSkjQiS6Rq+f0hC4IbQhZdiTzqc13QU9IPZLH+Uud8GH/eOY/d6V/iNHbxQ0bTNw==&lt;/diagram&gt;&lt;/mxfile&gt;">
<defs/>
<g>
<path d="M 60 80 L 60 163.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 60 168.88 L 56.5 161.88 L 60 163.63 L 63.5 161.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<ellipse cx="60" cy="40" rx="60" ry="40" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 40px; margin-left: 1px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
make_chart
</div>
</div>
</div>
</foreignObject>
<text x="60" y="44" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
make_chart
</text>
</switch>
</g>
<path d="M 60 230 L 60 303.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 60 308.88 L 56.5 301.88 L 60 303.63 L 63.5 301.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<path d="M 0 230 L 20 170 L 120 170 L 100 230 Z" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 200px; margin-left: 1px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
读取文件
</div>
</div>
</div>
</foreignObject>
<text x="60" y="204" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
读取文件
</text>
</switch>
</g>
<path d="M 60 370 L 60 433.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 60 438.88 L 56.5 431.88 L 60 433.63 L 63.5 431.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<path d="M 0 370 L 20 310 L 120 310 L 100 370 Z" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 340px; margin-left: 1px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
显示文件
</div>
</div>
</div>
</foreignObject>
<text x="60" y="344" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
显示文件
</text>
</switch>
</g>
<ellipse cx="60" cy="480" rx="60" ry="40" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 480px; margin-left: 1px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
结束
</div>
</div>
</div>
</foreignObject>
<text x="60" y="484" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
结束
</text>
</switch>
</g>
</g>
<switch>
<g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/>
<a transform="translate(0,-5)" xlink:href="https://www.diagrams.net/doc/faq/svg-export-text-problems" target="_blank">
<text text-anchor="middle" font-size="10px" x="50%" y="100%">
Text is not SVG - cannot display
</text>
</a>
</switch>
</svg>

After

Width:  |  Height:  |  Size: 7.4 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.9 KiB

@ -0,0 +1,68 @@
<mxfile host="65bd71144e">
<diagram id="jk39osZMkwa48vvCGBWW" name="第 1 页">
<mxGraphModel dx="333" dy="530" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="3" style="edgeStyle=none;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="2" target="4">
<mxGeometry relative="1" as="geometry">
<mxPoint x="100" y="190" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="2" value="sava_data" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="40" y="80" width="120" height="80" as="geometry"/>
</mxCell>
<mxCell id="7" style="edgeStyle=none;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="4" target="6">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="4" value="输入文件名" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="30" y="190" width="140" height="70" as="geometry"/>
</mxCell>
<mxCell id="9" style="edgeStyle=none;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="6" target="8">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="21" style="edgeStyle=none;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="6" target="20">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="6" value="打开文件" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="30" y="290" width="140" height="70" as="geometry"/>
</mxCell>
<mxCell id="12" style="edgeStyle=none;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="8" target="10">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="8" value="将所有成绩记录写入文件" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="27.5" y="390" width="145" height="80" as="geometry"/>
</mxCell>
<mxCell id="17" style="edgeStyle=none;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="10" target="18">
<mxGeometry relative="1" as="geometry">
<mxPoint x="100" y="610" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="10" value="关闭文件" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="30" y="500" width="140" height="80" as="geometry"/>
</mxCell>
<mxCell id="18" value="结束" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="40" y="630" width="120" height="80" as="geometry"/>
</mxCell>
<mxCell id="22" style="edgeStyle=none;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="20">
<mxGeometry relative="1" as="geometry">
<mxPoint x="100" y="600" as="targetPoint"/>
<Array as="points">
<mxPoint x="400" y="325"/>
<mxPoint x="400" y="600"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="20" value="提示打开文件失败" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="220" y="295" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="24" value="N" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="172.5" y="295" width="30" height="30" as="geometry"/>
</mxCell>
<mxCell id="25" value="Y" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="65" y="360" width="30" height="30" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

@ -0,0 +1,87 @@
<svg host="65bd71144e" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="121px" height="521px" viewBox="-0.5 -0.5 121 521" content="&lt;mxfile&gt;&lt;diagram id=&quot;yjX7MxzQul6X_D35qJ4Z&quot; name=&quot;Page-1&quot;&gt;3ZbBbqMwEIafxseVCA4EjiEl7aXSSjnscWWFCVgyGDlOIPv0a4cBwjrdVmqTSL3A+J8x9j98WBC6KttnxeriVWYgiO9lLaFPxPfnfmiuVjh1wiykcafkimeojcKG/wEUPVQPPIP9pFBLKTSvp+JWVhVs9URjSslmWraTYrpqzXJwhM2WCVf9xTNddGoUeKP+Ajwv+pVnHmZK1hejsC9YJpsLiaaErpSUuovKdgXCNq/vSzdv/UZ22JiCSn9kwrybcGTigN5wX/rUm4XMeMdhJStzSwpdCjOambArtzVv7gClvTyoLVbhKpqpHLCKDu4NNiBL0OpkShQIpvlx+nSG7y8f6kaLJkCX1x37juO9VPp3xjRzrQthkLKOm4Jr2NTsbKAxVF/rwhGUhvb/fXAd4gSKROA38aOHqRkBm/XUFBdwRd7nexI+hgLqUhDciQLqOk4jslyTJCFpQKI1iUOShvYaLUg6t3oSOl0xn29tQ2OUCQFC5oqVph81KG72BOrf3M8x8R5TO95Cf/bdhrGBp/cYC7+AsegxjAUuY4s7MRZcYczglJLYt4wlS4vZ9yJqIOUeRC0+0l8TLFMSrc6piMSe0/EHHvI0vt0hb4bjb8Q5d/EzRtO/&lt;/diagram&gt;&lt;/mxfile&gt;">
<defs/>
<g>
<path d="M 60 80 L 60 163.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 60 168.88 L 56.5 161.88 L 60 163.63 L 63.5 161.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<ellipse cx="60" cy="40" rx="60" ry="40" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 40px; margin-left: 1px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
sort_data
</div>
</div>
</div>
</foreignObject>
<text x="60" y="44" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
sort_data
</text>
</switch>
</g>
<path d="M 60 230 L 60 303.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 60 308.88 L 56.5 301.88 L 60 303.63 L 63.5 301.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<path d="M 0 230 L 20 170 L 120 170 L 100 230 Z" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 200px; margin-left: 1px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
读取文件
</div>
</div>
</div>
</foreignObject>
<text x="60" y="204" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
读取文件
</text>
</switch>
</g>
<path d="M 60 370 L 60 433.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 60 438.88 L 56.5 431.88 L 60 433.63 L 63.5 431.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<path d="M 0 370 L 20 310 L 120 310 L 100 370 Z" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 340px; margin-left: 1px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
排序
</div>
</div>
</div>
</foreignObject>
<text x="60" y="344" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
排序
</text>
</switch>
</g>
<ellipse cx="60" cy="480" rx="60" ry="40" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 480px; margin-left: 1px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
排序完成
</div>
</div>
</div>
</foreignObject>
<text x="60" y="484" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
排序完成
</text>
</switch>
</g>
</g>
<switch>
<g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/>
<a transform="translate(0,-5)" xlink:href="https://www.diagrams.net/doc/faq/svg-export-text-problems" target="_blank">
<text text-anchor="middle" font-size="10px" x="50%" y="100%">
Text is not SVG - cannot display
</text>
</a>
</switch>
</svg>

After

Width:  |  Height:  |  Size: 7.4 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.9 KiB

@ -1,37 +1,37 @@
<mxfile host="65bd71144e">
<diagram id="5al8SiqKVGW9Og6V7Dn-" name="第 1 页">
<mxGraphModel dx="487" dy="568" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<mxGraphModel dx="1072" dy="568" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="4" value="" style="edgeStyle=none;html=1;" edge="1" parent="1" source="2" target="3">
<mxCell id="4" value="" style="edgeStyle=none;html=1;" parent="1" source="2" target="3" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="2" value="update_data" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="2" value="update_data" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="310" y="120" width="110" height="70" as="geometry"/>
</mxCell>
<mxCell id="6" value="" style="edgeStyle=none;html=1;" edge="1" parent="1" source="3" target="5">
<mxCell id="6" value="" style="edgeStyle=none;html=1;" parent="1" source="3" target="5" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="8" value="" style="edgeStyle=none;html=1;" edge="1" parent="1" source="3" target="7">
<mxCell id="8" value="" style="edgeStyle=none;html=1;" parent="1" source="3" target="7" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="3" value="输入学号" style="whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="3" value="输入学号" style="whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="305" y="275" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="13" value="" style="edgeStyle=none;html=1;" edge="1" parent="1" source="5" target="12">
<mxCell id="13" value="" style="edgeStyle=none;html=1;" parent="1" source="5" target="12" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="5" value="输入姓名,成绩" style="whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="5" value="输入姓名,成绩" style="whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="305" y="415" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="7" value="学生不存在" style="whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="7" value="学生不存在" style="whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="505" y="275" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="12" value="结束" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="12" value="结束" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="325" y="545" width="80" height="45" as="geometry"/>
</mxCell>
<mxCell id="14" value="" style="edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="7">
<mxCell id="14" value="" style="edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" parent="1" source="7" edge="1">
<mxGeometry width="100" relative="1" as="geometry">
<mxPoint x="570" y="390" as="sourcePoint"/>
<mxPoint x="370" y="520" as="targetPoint"/>
@ -40,10 +40,10 @@
</Array>
</mxGeometry>
</mxCell>
<mxCell id="15" value="Y" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxCell id="15" value="Y" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="335" y="355" width="30" height="30" as="geometry"/>
</mxCell>
<mxCell id="16" value="N" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxCell id="16" value="N" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="445" y="265" width="30" height="30" as="geometry"/>
</mxCell>
</root>

@ -0,0 +1,354 @@
#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 <stdio.h>
#include <stdlib.h>
//定义常量
#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;
}
// 函数定义
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);
}
else
{
printf("学生已存在");
}
}
//修改
void update_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)
{
printf("学生不存在");
}
else
{
printf("输入学生学号:");
scanf("%d", &stu[num].number);
printf("输入学生姓名:");
scanf("%s", stu[num].name);
printf("输入学生成绩:");
scanf("%d", &stu[num].score);
printf("学生 %d 已更新", num);
}
}
//删除
void delete_data(void)
{
int num;
printf("输入学生学号:");
scanf("%d", &num);
int f = 0, i, j;
for (i = 0; i < num_parts; i++)
{
if (num == stu[i].number)
{
f = 1;
break;
}
}
if (f == 0)
{
printf("学生不存在");
}
else
{
for (j = i; j < num_parts - 1; j++)
{
stu[j] = stu[j + 1];
}
num_parts--;
printf("删除成功");
}
}
void read_data(void)
{
puts("读取数据");
printf("请输入文件名");
char filename[256];
scanf("%s", filename);
FILE *fp = fopen(filename, "r");
if (fp == NULL)
{
perror(filename);
return;
}
int i = 0;
while (fscanf(fp, "%d,%[^,],%d", &stu[i].number, stu[i].name, &stu[i].score) == 3)
{
i++;
}
fclose(fp);
num_parts = i;
printf("读取 %d 记录\n", num_parts);
}
void save_data(void)
{
puts("保存数据");
printf(" 请输入文件名");
char filename[256];
scanf("%s", filename);
FILE *fp = fopen(filename, "r");
if (fp == NULL)
{
perror(filename);
return;
}
for (int i = 0; i < num_parts; i++)
{
fprintf(fp, "%d,%s,%d\n", stu[i].number, stu[i].name, stu[i].score);
}
fclose(fp);
printf("保存%d 成功", num_parts);
}
//排序
void sort_data(void)
{
printf("排序\n");
for (int i = 0; i < num_parts; i++)
{
int change = 0;
static struct students t;
for (int j = 0; j < num_parts - i - 1; j++)
{
if (stu[j].number > stu[j + 1].number)
{
t = stu[j + 1];
stu[j + 1] = stu[j];
stu[j] = t;
change = 1;
}
}
if (!change)
break;
}
for (int i = 0; i < num_parts; i++)
{
int change = 0;
static struct students t;
for (int j = 0; j < num_parts - i - 1; j++)
{
if (stu[j].score > stu[j + 1].score)
{
t = stu[j + 1];
stu[j + 1] = stu[j];
stu[j] = t;
change = 1;
}
}
if (!change)
break;
}
printf("排序已完成");
}
void make_chart(void)
{
printf("NUMBER | NAME score\n");
for (int i = 0; i < num_parts; i++)
{
printf("%d | %s ", stu[i].number, stu[i].name);
for (int j = 0; j < stu[i].score; j++)
{
printf("*");
}
printf("\n");
}
printf("图表\n");
}
int confirm(const char *msg)
{
char c = 'n'; // 默认选择是 no
printf("%s(Y/N): ", msg); // 提示输入 yes/no 进行确认
scanf(" %c%*[^\n]", &c); // 读取第一个字符,忽略剩余字符
return c == 'y' || c == 'Y'; // 返回确认结果
}
Loading…
Cancel
Save