请用C语言编译

来源:百度知道 编辑:UC知道 时间:2024/07/02 15:22:08
教学事务管理系统
该系统在磁盘上存储如下信息:
1。注册信息,每个学期的注册信息应包括每个已注册学生的班级代号、学号、姓名、注册的学期。
2。选课信息。包括已注册的每个学生每个学期所选课程。本程序仅限一年级2个学期。
3。成绩。 每个学生所选的课程的考核成绩,包括补考成绩。
该系统的功能:
1。能输入注册信息,选课信息和成绩。
2。能输出一下表格:
1)分班的某门课程不及格名单(含学号,姓名,成绩)
2)某门课程全年级前5名的学号,姓名,成绩
3)某门课程的选修者名单;
4)某个学生本学期的成绩单
5)某门课程每个班的总平均粉(从高到低排列)
6)某门课程某班的成绩单(按学号排列)

#include "stdio.h" /*I/O函数*/
#include "stdlib.h" /*其它说明*/
#include "string.h" /*字符串函数*/
#include "conio.h" /*屏幕操作函数*/
#include "mem.h" /*内存操作函数*/
#include "ctype.h" /*字符操作函数*/
#include "alloc.h" /*动态地址分配函数*/
struct score
{
int mingci;
char xuehao[8];
char mingzi[20];
float score[6];
}data,info[1000];
int i,j,k=0;
char temp[20],ch;
FILE *fp,*fp1;

void shuru()
{
if((fp=fopen("s_score.txt","ab+"))==NULL)
{
printf("cannot open this file.\n");
getch();exit(0);
}
for(i=0;i<=1000;i++)
{
printf("\nPlease shuru xuehao:");
gets(data.xuehao);
printf("Please shuru mingzi:");
gets(data.mingzi);
printf("Please shuru yuwen score:");
gets(temp);data.score[0]=a