资源描述:
《C语言大作业学生成绩查询系统源代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、#include#includestructstudent{charname[20];charspeciality[10];intC;intmath;intEnglish;intPE;intChinese;}student[13]={{"zhangting","通信工程",85,80,90,80,88},{"zhangsan","通信工程",90,91,89,87,88},{"wangwu","通信工程",90,90,90,90,90},{"zhouyue","通信工程",90,89,98,88,90},{"zhangjiabang","通信
2、工程",88,98,90,90,88},{"tianfu","通信工程",90,97,86,87,56},{"wudong","通信工程",89,87,86,85,84},{"luhuiping","通信工程",87,81,90,80,81},{"zhafengyun","通信工程",90,89,87,86,85},{"wulin","通信工程",90,90,89,81,72},{"wangyun","通信工程",87,78,69,89,90},{"yangyu","通信工程",90,78,67,82,83},{"lili","通信工程",80,86,83,84,78}};voi
3、dmain(){structstudent*p;p=student;inti,j,temp,sum,sum1=0,sum2=0,sum3=0,sum4=0,sum5=0,sum6=0,count=0;doubleave1,ave2,ave3,ave4,ave5,ave6;charxname[10];printf("t**********学生成绩查询系统**********t");printf("请务必确认你输入的名字是正确的,否则将无法输出你的个人成绩,只能显示班内的成绩总况");printf("你的名字是:");scanf("%s",xname);printf("你
4、的专业是通信工程");for(i=0;i<13;i++,p++)if(strcmp(xname,p->name)==0){printf("你的各科成绩如下:");printf("C:%d",(*p).C);printf("math:%d",(*p).math);printf("English:%d",(*p).English);printf("PE:%d",(*p).PE);printf("Chinese:%d",(*p).Chinese);sum1=(*p).C+(*p).math+(*p).English+(*p).PE+(*p).Chinese;
5、ave1=sum1/5.0;printf("你的总分为:%d平均分为:%f",sum1,ave1);}{for(i=0;i<13;i++)sum2=sum2+student[i].C;ave2=sum2/13.0;printf("C语言的总分为:%d平均分为:%f",sum2,ave2);}{for(i=0;i<13;i++)sum3=sum3+student[i].math;ave3=sum3/13.0;printf("数学的总分为:%d平均分为:%f",sum3,ave3);}{for(i=0;i<13;i++)sum4=sum4+stud
6、ent[i].English;ave4=sum4/13.0;printf("英语的总分为:%d平均分为:%f",sum4,ave4);}{for(i=0;i<13;i++)sum5=sum5+student[i].PE;ave5=sum5/13.0;printf("体育的总分为:%d平均分为:%f",sum5,ave5);}{for(i=0;i<13;i++)sum6=sum6+student[i].Chinese;ave6=sum6/13.0;printf("语文的总分为:%d平均分为:%f",sum6,ave6);}{for(i=0;i<1
7、3;i++)if(student[i].C<60)count+=1;printf("C语言不及格人数为%d",count);}{for(i=0;i<13;i++)if(student[i].math<60)count+=1;printf("数学不及格人数为%d",count);}{for(i=0;i<13;i++)if(student[i].English<60)count+=1;printf("英语不及格人数为%d",count);}{for(i=0;i