#include
#include
#include
int readstudents(struct students stu[]); //读取学生信息
int readsexcode(struct sexcode sex[]); //读取性别代码
int readcollegecode(struct collegecode colle[]); //读取学院代码
void transform(struct students stu[],struct sexcode sexy[],struct collegecode colle[],int a,int b,int c); //录入
void namesort(struct students stu[],int a); //按照姓名排序
void averagesort(struct students stu[],int a); //平均分排序
void searchcollege(struct students stu[],int a); //按学院搜索学生
void namesearch(struct students stu[],int a); //按名字搜索
void printstudent(struct students stu[],struct sexcode sex[],struct collegecode colle[],int a,int b,int c); //输出
void change(struct students stu[],int a);
int passwordfun();
void passwordchange();
void averagefun(struct students stu[],int a);
struct students{
int num;
char name[];
int sexnum;
char sex[];
int collegenum;
char college[];
int score[];
float average;
};
struct sexcode{
int sexnum;
char sex[];
};
struct collegecode{
int collegenum;
char college[];
};
int main()
{
int a,b,c;
int choice;
struct students stu[];
struct sexcode sexy[];
struct collegecode colle[];
int t = passwordfun();
if(t == ){
printf("请使用正确密码重新登陆程序!\n");
return ;
}
while(){
system("cls");
printf("***********学生成绩系统菜单************ \n* 1. 原始文件读取 *\n* 2. 按姓名排序,输出 *\n* 3. 按平均成绩排序,输出 *\n* 4. 输出给定学院学生 *\n* 5. 修改给定学生成绩信息 *\n* 6. 按姓名查询学生,输出 *\n* 7. 修改系统密码 *\n* 0. 返回上一级菜单 *\n***************************************\n");
scanf("%d",&choice);
switch(choice){
case : system("cls");
a = readstudents(stu);
b = readsexcode(sexy);
c = readcollegecode(colle);
transform(stu,sexy,colle,a,b,c);
averagefun(stu,a);
printf("原始文件读取完毕!\n0. 返回上一级菜单 \n");
scanf("%d",&choice);
if(choice == ) break;
case : system("cls");
namesort(stu,a);
printstudent(stu,sexy,colle,a,b,c);
printf("\n0. 返回上一级菜单 \n");
scanf("%d",&choice);
if(choice == ) break;
case : system("cls");
averagesort(stu,a);
printstudent(stu,sexy,colle,a,b,c);
printf("\n0. 返回上一级菜单 \n");
scanf("%d",&choice);
if(choice == ) break;
case : system("cls");
searchcollege(stu,a);
printf("\n0. 返回上一级菜单 \n");
scanf("%d",&choice);
if(choice == ) break;
case : system("cls");
change(stu,a);
printf("修改成功!\n");
printf("\n0