怎样用C语言编写《学生成绩管理系统》程序

来源:百度知道 编辑:UC知道 时间:2024/05/22 13:08:29
希望大家能帮助我解决这个问题~~~~
要求:
使用文本文件或二进制文件保存学生成绩。

提供学生成绩的查询功能,输入学生的学号或姓名,能查找出该生的成绩。

能对成绩数据进行添加、删除、修改等基本操作,并能进行一般的统计计算(如计算学生的总分和平均分,课程的平均分等)

提供简易的菜单方便进行操作。

#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