|
|
@ -214,4 +214,99 @@ Not found!
|
|
|
|
```
|
|
|
|
```
|
|
|
|
Please Input your choice: 10
|
|
|
|
Please Input your choice: 10
|
|
|
|
For course 1:
|
|
|
|
For course 1:
|
|
|
|
|
|
|
|
<60 0 0.00%
|
|
|
|
|
|
|
|
60-70 0 0.00%
|
|
|
|
|
|
|
|
70-80 2 50.00%
|
|
|
|
|
|
|
|
80-90 1 25.00%
|
|
|
|
|
|
|
|
90-100 0 0.00%
|
|
|
|
|
|
|
|
100 1 25.00%
|
|
|
|
|
|
|
|
For course 2:
|
|
|
|
|
|
|
|
<60 0 0.00%
|
|
|
|
|
|
|
|
60-70 0 0.00%
|
|
|
|
|
|
|
|
70-80 0 00.00%
|
|
|
|
|
|
|
|
80-90 2 50.00%
|
|
|
|
|
|
|
|
90-100 2 50.00%
|
|
|
|
|
|
|
|
100 0 0.00%
|
|
|
|
|
|
|
|
For course 3:
|
|
|
|
|
|
|
|
<60 0 0.00%
|
|
|
|
|
|
|
|
60-70 0 0.00%
|
|
|
|
|
|
|
|
70-80 0 0.00%
|
|
|
|
|
|
|
|
80-90 1 25.00%
|
|
|
|
|
|
|
|
90-100 2 50.00%
|
|
|
|
|
|
|
|
100 1 25.00%
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
### 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 从文件中读取学生信息
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
选择菜单命令 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|