int main() //主函数
{
LINK head ;
int i = 0 ;
int choice = 0 ;
Uers pe[6] ;
int C_ount = 0 ;
int Cishu = 0;
int nnu;
char sex[20];
int old;
int x;
int y ;
float a,b;
long z;
long w;
while(1)
{
printf("请您登陆或注册用户n");
printf("注册 = 1 ,登陆 = 2n");
scanf("%d",&choice);
fflush(stdin);
if(choice == 1)
{
Cishu = ZhuCe(pe,&C_ount);
while(!Cishu)
{
Cishu = 2;
break;
}
break;
}
else if(choice == 2)
{
Cishu = DengLu(pe,C_ount);
if(Cishu == 5)
{
break;
}
while(!Cishu)
{
Cishu = DengLu(pe,C_ount);
}
if(Cishu == 2)
{
break;
}
}
else
{
printf("输入错误请重新输入n");
}
}
if(Cishu == 2)
{
return 0;
}
while (1)
{
i = Menu();
if (i == 1)
{
printf("ttt******************************************************************************n");
}
switch (i)
{
case 2: //按平均分从高到低输出学生成绩;
Sort(head,PaixuAverage);
PrintAllStudentInformation(head);
break;
case 3: //按单门学科成绩从高到低输出学生信息;
printf("数学 = 0,语文 = 1,英语 = 2n");
printf("请输入你的选择n");
scanf("%d",&nnu);
head = s_ort(head ,desc, nnu);
PrintAllStudentInformation(head);
break;
case 4: //按学号从小到大顺序输出学生基本信息;
Sort(head,paixuxueHao);
PrintAllStudentInformation(head);
break;
case 5: //按字典从小到大顺序输出学生基本信息;
paixuName(head);
PrintAllStudentInformation(head);
break;
case 6: //按年龄和性别查找学生的基本信息;
printf("请输入学生的年龄和性别n");
scanf("%d",&old);
getchar();
gets(sex);
fflush(stdin);
SearchStudent(head,sex,old);
break;
case 7: // 查找某门课成绩最高的学生的基本信息,某门课成绩最高的可能不只一名学生
printf("请输入科目 n");
printf("数学 = 0 ,语文 = 1 ,英语 = 2n");
fflush(stdin);
scanf("%d",&x);
SearchHighscore(head ,x);
break;
case 8: //查找某门课成绩在某个分数段内的学生人数和学生基本信息
printf("请输入科目n");
printf("数学 = 0 ,语文 = 1 ,英语 = 2n");
fflush(stdin);
scanf("%d",&y);
fflush(stdin);
printf("请输入分数区间,像:22--33 ");
scanf("%f%f",&a,&b);
PrintFenShuduan(head ,y ,a, b);
break;
case 9: //按学号查找学生基本信息,对学生信息进行修改后保存;
printf("请输入学生学号n");
scanf("%ld",&z);
XiuGaiInformation(head,z);
break;
case 10: //按学号删除学生信息
printf("请输入学生学号n");
scanf("%ld",&w);
DeleteStudentInformation(head ,w);
break;
case 11: //插入一名新的学生信息
InsertStudentInformation(head);
Old(head);
break;
case 12: //将学生信息写入文件
FileWrite(head);
break;
case 13: //按照姓名从文件读取学生信息
head = FileRead();
break;
case 1: //录入每个学生的基本信息
head = Input(head);
Average(head);
Old(head);
break;
case 0:
printf("nnn");
printf("ttt******************************************************************************n");
printf("tttEnd of program!n");
printf("ttt******************************************************************************n");
return 0;
default:
printf("nnn");
printf("ttt******************************************************************************n");
printf("tttInput error!n");
printf("ttt******************************************************************************n");
}
}
return 0;
}
本文发布于:2024-01-28 22:29:17,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170645216310736.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |