600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > c语言管理系统的数据存放 编的学生成绩管理系统 从文件中读取保存数据总会多读入一

c语言管理系统的数据存放 编的学生成绩管理系统 从文件中读取保存数据总会多读入一

时间:2020-08-27 10:39:09

相关推荐

c语言管理系统的数据存放 编的学生成绩管理系统 从文件中读取保存数据总会多读入一

该楼层疑似违规已被系统折叠隐藏此楼查看此楼

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)

{

c语言管理系统的数据存放 编的学生成绩管理系统 从文件中读取保存数据总会多读入一组乱码数据...

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。