#includestdio.h#includestring.hstructstudent{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,通信工程,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}};voidmain(){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(\n请务必确认你输入的名字是正确的,否则将无法输出你的个人成绩,只能显示班内的成绩总况\n);printf(你的名字是:);scanf(%s,xname);printf(你的专业是通信工程\n);for(i=0;i13;i++,p++)if(strcmp(xname,p-name)==0){printf(你的各科成绩如下:);printf(\nC:%d,(*p).C);printf(\nmath:%d,(*p).math);printf(\nEnglish:%d,(*p).English);printf(\nPE:%d,(*p).PE);printf(\nChinese:%d\n,(*p).Chinese);sum1=(*p).C+(*p).math+(*p).English+(*p).PE+(*p).Chinese;ave1=sum1/5.0;printf(\n你的总分为:%d\n平均分为:%f\n,sum1,ave1);}{for(i=0;i13;i++)sum2=sum2+student[i].C;ave2=sum2/13.0;printf(\nC语言的总分为:%d\n平均分为:%f\n,sum2,ave2);}{for(i=0;i13;i++)sum3=sum3+student[i].math;ave3=sum3/13.0;printf(\n数学的总分为:%d\n平均分为:%f\n,sum3,ave3);}{for(i=0;i13;i++)sum4=sum4+student[i].English;ave4=sum4/13.0;printf(\n英语的总分为:%d\n平均分为:%f\n,sum4,ave4);}{for(i=0;i13;i++)sum5=sum5+student[i].PE;ave5=sum5/13.0;printf(\n体育的总分为:%d\n平均分为:%f\n,sum5,ave5);}{for(i=0;i13;i++)sum6=sum6+student[i].Chinese;ave6=sum6/13.0;printf(\n语文的总分为:%d\n平均分为:%f\n,sum6,ave6);}{for(i=0;i13;i++)if(student[i].C60)count+=1;printf(\nC语言不及格人数为%d\n,count);}{for(i=0;i13;i++)if(student[i].math60)count+=1;printf(\n数学不及格人数为%d\n,count);}{for(i=0;i13;i++)if(student[i].English60)count+=1;printf(\n英语不及格人数为%d\n,count);}{for(i=0;i13;i++)if(student[i].PE60)count+=1;printf(\n体育不及格人数为%d\n,count);}{for(i=0;i13;i++)if(student[i].Chinese60)count+=1;printf(\n语文不及格人数为%d\n,count);}for(i=0;i13;i++)for(j=i+1;j13;j++)if(student[i].Cstudent[j].C){temp=student[i].C;student[i].C=student[j].C;student[j].C=temp;}printf(\nC语言的成绩由高到低排列为:\n);for(i=0;i13;i++)printf(%4d,student[i].C);for(i=0;i13;i++)for(j=i+1;j13;j++)if(student[i].mathstudent[j].math){temp=student[i].math;student[i].math=student[j].math;student[j].math=temp;}printf(\n数学的成绩由高到低排列为:\n);for(i=0;i13;i++)printf(%4d,student[i].math);for(i=0;i13;i++)for(j=i+1;j13;j++)if(student[i].Englishstudent[j].English){temp=student[i].English;student[i].English=student[j].English;student[j].English=temp;}printf(\n英语的成绩由高到低排列为:\n);for(i=0;i13;i++)printf(%4d,student[i].English);for(i=0;i13;i++)for(j=i+1;j13;j++)if(student[i].PEstudent[j].PE){temp=student[i].PE;student[i].PE=student[j].PE;student[j].PE=temp;}printf(\n体育的成绩由高到低排列为:\n);for(i=0;i13;i++)printf(%4d,student[i].PE);for(i=0;i13;i++)for(j=i+1;j13;j++)if(student[i].Chinesestudent[j].Chinese){temp=student[i].Chinese;student[i].Chinese=student[j].Chinese;student[j].Chinese=temp;}printf(\n语文的成绩由高到低排列为:\n);for(i=0;i13;i++)printf(%4d,student[i].Chinese);printf(\n);}