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)

{

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值