|
|
|
@ -233,61 +233,64 @@ For course 3:
|
|
|
|
|
C12: 打印学生信息
|
|
|
|
|
选择菜单命令11,打印
|
|
|
|
|
````
|
|
|
|
|
Please Input your choice: 11
|
|
|
|
|
2214111006 XuZilin 100 95 86 281 93
|
|
|
|
|
2214111009 XuZigui 77 89 99 265 88
|
|
|
|
|
2214111011 ZhangYu 85 91 98 274 91
|
|
|
|
|
2214111025 LiYujia 75 89 100 264 88
|
|
|
|
|
请输入你的选择:11
|
|
|
|
|
2214111018 李玉璇 100 95 86 281 93
|
|
|
|
|
2214111038 张桐桐 77 89 99 265 88
|
|
|
|
|
2214111026 孟婷玉 85 91 98 274 91
|
|
|
|
|
2214111022 周羽凡 75 89 100 264 88
|
|
|
|
|
````
|
|
|
|
|
C13: 将学生信息保存在文件中
|
|
|
|
|
选择菜单命令 12 ,将学生信息保存在文件 student.txt 中。如果文件不存在,则给出错误信息并退出程序,否则逐个读入
|
|
|
|
|
````
|
|
|
|
|
Please Input your choice: 12
|
|
|
|
|
Failure to open score.txt!
|
|
|
|
|
1 Input record
|
|
|
|
|
2 Calculate total and average score of every course
|
|
|
|
|
3 Calculate total and average score of every student
|
|
|
|
|
4 Sort in descending order by score
|
|
|
|
|
5 Sort in ascending order by score
|
|
|
|
|
6 Sort in ascending order by number
|
|
|
|
|
7 Sort in dictionary order by name
|
|
|
|
|
8 Search by number
|
|
|
|
|
9 Search by name
|
|
|
|
|
10 Statistic analysis
|
|
|
|
|
11 List record
|
|
|
|
|
12 Write to a file
|
|
|
|
|
13 Read from a file
|
|
|
|
|
0 Exit
|
|
|
|
|
Please Input your choice: 12
|
|
|
|
|
2214111006 XuZilin 100 95 86 281 93
|
|
|
|
|
2214111009 XuZigui 77 89 99 265 88
|
|
|
|
|
2214111011 ZhangYu 85 91 98 274 91
|
|
|
|
|
2214111025 LiYujia 75 89 100 264 88
|
|
|
|
|
请输入你的选择:12
|
|
|
|
|
未能打开你的成绩!
|
|
|
|
|
1 输入成绩
|
|
|
|
|
2 计算所有课程的总分和平均值
|
|
|
|
|
3 计算所有学生的总分和平均值
|
|
|
|
|
4 按分数降序排列
|
|
|
|
|
5 按分数升序排列
|
|
|
|
|
6 按数字升序排列
|
|
|
|
|
7 按名字字母排列
|
|
|
|
|
8 按数字搜索
|
|
|
|
|
9 按名字搜索
|
|
|
|
|
10 统计分析
|
|
|
|
|
11 列表记录
|
|
|
|
|
12 写入文件
|
|
|
|
|
13 从文件中读取
|
|
|
|
|
0 退出
|
|
|
|
|
请输入你的选择:12
|
|
|
|
|
2214111018 李玉璇 100 95 86 281 93
|
|
|
|
|
2214111038 张桐桐 77 89 99 265 88
|
|
|
|
|
2214111026 孟婷玉 85 91 98 274 91
|
|
|
|
|
2214111022 周羽凡 75 89 100 264 88
|
|
|
|
|
|
|
|
|
|
````
|
|
|
|
|
C14:从文件中读取学生信息
|
|
|
|
|
选择菜单命令 13 ,从文件中读取学生的学号、姓名及成绩等信息写入到结构体数组 stu 中。如果文件为空,则给出错误信息并退出程序,反之,逐个读入
|
|
|
|
|
````
|
|
|
|
|
Please Input your choice: 13
|
|
|
|
|
Failure to open score.txt!
|
|
|
|
|
1 Input record
|
|
|
|
|
2 Calculate total and average score of every course
|
|
|
|
|
3 Calculate total and average score of every student
|
|
|
|
|
4 Sort in descending order by score
|
|
|
|
|
5 Sort in ascending order by score
|
|
|
|
|
6 Sort in ascending order by number
|
|
|
|
|
7 Sort in dictionary order by name
|
|
|
|
|
8 Search by number
|
|
|
|
|
9 Search by name
|
|
|
|
|
10 Statistic analysis
|
|
|
|
|
11 List record
|
|
|
|
|
12 Write to a file
|
|
|
|
|
13 Read from a file
|
|
|
|
|
0 Exit
|
|
|
|
|
Please Input your choice: 13
|
|
|
|
|
2214111006 XuZilin 100 95 86 281 93
|
|
|
|
|
2214111009 XuZigui 77 89 99 265 88
|
|
|
|
|
2214111011 ZhangYu 85 91 98 274 91
|
|
|
|
|
2214111025 LiYujia 75 89 100 264 88
|
|
|
|
|
请输入你的选择:13
|
|
|
|
|
未能打开你的成绩!
|
|
|
|
|
1 输入成绩
|
|
|
|
|
2 计算所有课程的总分和平均值
|
|
|
|
|
3 计算所有学生的总分和平均值
|
|
|
|
|
4 按分数降序排列
|
|
|
|
|
5 按分数升序排列
|
|
|
|
|
6 按数字升序排列
|
|
|
|
|
7 按名字字母排列
|
|
|
|
|
8 按数字搜索
|
|
|
|
|
9 按名字搜索
|
|
|
|
|
10 统计分析
|
|
|
|
|
11 列表记录
|
|
|
|
|
12 写入文件
|
|
|
|
|
13 从文件中读取
|
|
|
|
|
0 退出
|
|
|
|
|
请输入你的选择:12
|
|
|
|
|
2214111018 李玉璇 100 95 86 281 93
|
|
|
|
|
2214111038 张桐桐 77 89 99 265 88
|
|
|
|
|
2214111026 孟婷玉 85 91 98 274 91
|
|
|
|
|
2214111022 周羽凡 75 89 100 264 88
|
|
|
|
|
|
|
|
|
|
````
|
|
|
|
|
````
|
|
|
|
|
//李玉璇、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、
|
|
|
|
|
概要设计
|
|
|
|
|