求~~!在TC下的程序源代码!~《学生成绩查询系统》

来源:百度知道 编辑:UC知道 时间:2024/06/05 12:49:51
题目:学生成绩管理
内容:1、使用结构体数组定义学生基本信息(学号、姓名、年龄)及成绩(C语言成绩、英语成绩和数据库成绩)。如下:
struct student
{
int id,age,cscore,enscore,dbscore;
char name[21];
}students[5];
2、实现学生基本信息(学号、姓名、年龄)及成绩(C语言成绩、英语成绩和数据库成绩)的录入。
3、基本信息的查询(根据学号)与修改(根据学号)
4、根据每科成绩,求出每个人的总分
5、对学生考试成绩进行排序(根据学号或各科成绩排序)
6、输出显示功能选择提示。
7、每个功能以一个单独的函数实现。

#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