该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
getch();
return L;
}
}
void SearchData(Stu L)
{
Stu p;
int num;
p=L->next;
printf("Input the ID of the student you want to search:");
scanf("%d",&num);
while(p!=NULL)
{
if(p->num==num) { printf("---------No.%d %s-------\nMath:%d Chinese:%d English:%d Total:%d Average:%d\n",p->num,p->name,p->math,p->chinese,p->english,p->total,p->average);break;}
p=p->next;
}
if(p==NULL) {printf("Cannot find the student.");}
getch();
}
void StatData(Stu L)
{
Stu p;
int MathTotal=0,ChineseTotal=0,EnglishTotal=0,n=0;
p=L->next;
while(p!=NULL)
{
MathTotal=MathTotal+p->math;
ChineseTotal=ChineseTotal+p->chinese;
EnglishTotal=EnglishTotal+p->english;
n++;
p=p->next;
}
printf("-------------The Status of the Class------------\n");
printf("1.Math\nTotal:%d Average:%d\n",MathTotal,MathTotal/n);
printf("2.Chinese\nTotal:%d Average:%d\n",ChineseTotal,ChineseTotal/n);
printf("3.English\nTotal:%d Average:%d\n",EnglishTotal,EnglishTotal/n);
printf("Press any key to continue......");
getch();
}
void RangeData(Stu L)
{
int max,min;
Stu p;
p=L->next;
printf("Input the upper limit of the score:");
scanf("%d",&max);
printf("Input the lower limit of the score:");
scanf("%d",&min);
printf("-------------------------------------------------\n");
printf("| num | math |english| china | sum | ave |\n");
printf("-------------------------------------------------\n");
while(p!=NULL)
{