1 / 40
文档名称:

成绩管理系统源代码.doc

格式:doc   页数:40页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

成绩管理系统源代码.doc

上传人:wsh309048309 2015/11/1 文件大小:0 KB

下载得到文件列表

成绩管理系统源代码.doc

相关文档

文档介绍

文档介绍:#include<>
#include<>
#include<>
#include<>
#include<>
/*控制学生记录的容量*/
#define N 40
#define PR printf("\n\r%s %s %s %s %s %s %s %s %s %s %s ",stu[i].num,stu[i].name,stu[i].score[0],stu[i].score[1],stu[i].score[2],stu[i].score[3],stu[i].score[4],stu[i].score[5],stu[i].score[6],stu[i].score[7],stu[i].score[8],stu[i].ave)
struct student
{char num[11];
char name[20];
int score[3];
float ave;
}stu[N];
typedef struct node {unsigned long int key;
struct node * link;}HNode;
typedef struct{int key; /*排序码*/
float data;/*其他数据项*/}ode;
/*全新保存函数*/
save(int n) /*保存函数,保存n个记录*/
{FILE *fp;
int i;
if((fp=fopen("","wb"))==NULL) /*以输出打开方式,在此前的记录被覆盖*/
{printf("\n不能打开文件\n");
getch();return NULL;
}
for(i=0;i<n;i++)
if(stu[i].ave!=0) /*stu[i].ave=0表此记录已删除*/
if(fwrite(&stu[i],sizeof(struct student),1,fp)!=1)
printf("文件输入错误\n");
fclose(fp);
return 0;
}
/*加载记录或可以计算记录个数的函数*/
int load() /*加载记录或可以计算记录个数的函数*/
{FILE *fp;
int i;
if((fp=fopen("","rb"))==NULL) /*以输出打开方式,在此前的记录被覆盖*/
{printf("\n不能打开文件\n");
getch();return NULL;
}
for(i=0;!feof(fp);i++)
fread(&stu[i],sizeof(struct student),1,fp);
fclose(fp);
return(i-1); /*返回记录个数*/
}
void puts___() /*显出---函数*/
{puts("\n--------------------------------------------------------------------");
}
/*显示数据结构项目函数*/
void printf_face() /*显示数据结构项目*/
{printf("\n 学号姓名数学英语计算机平均分\n");
}
/*显示一个记录的函数*/
printf_one(int i) /*显示一个记录的函数*/
{int j;
printf("%12s %-9s",stu[i].num,stu[i].name);
for(j=0;j<3;j++)
printf("%-6d",stu[i].score[j]);
printf("%-\n",stu[i].ave);
return 0;
}
teacher();
/****************浏览(全部)模块****************/
browse() /*浏览(全部)模块*/
{int i,n;
n=load(); /*加载记录*/
system("cls");
puts___();
printf_face(); /*调用显示数据结构项目函数*/
for(i=0;i<n;i++)
{if((i!=0)&&(i%10==0)) /*目的是分屏显示*/
{printf("\n\nPass any key to contiune . . .");
getch();
puts("\n\n");
}
printf_one(i); /*调用显示一个记录的函数*/
}
puts___();
print