欢迎来到天天文库
浏览记录
ID:55742391
大小:31.00 KB
页数:3页
时间:2020-06-04
《综合实训项目源程序综合实训项目源程序8学生成绩系统.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、综合项目源程序:学生成绩系统综合作业任务:/*考试结束后老师登记N个学生的成绩,学生的基本信息包括姓名(chName)、期中成绩(iMiddle)、期末成绩(iFinal)和平均成绩(fAve),请编写程序满足若干要求。*/#include"stdio.h"#defineN3structstudent{charchName[8];intiMiddle,iFinal;floatfAve;};/*定义结构体类型*/voidinputInfo(structstudentstu[]);voidprintInfo(structstudentstu[]);voidmaxSc
2、ore(structstudentstu[]);voidsortScore(structstudentstu[]);voidinputInfo(structstudentstu[])/*输入信息函数体*/{inti;for(i=0;i3、}voidprintInfo(structstudentstu[])/*打印输出信息函数体*/{inti;for(i=0;i4、f(stu[stuMax].fAve5、序法对成绩数组进行排序*/{for(j=N-1;j>=i;j--){if(stu[j].fAve>stu[j-1].fAve){temp=stu[j];stu[j]=stu[j-1];stu[j-1]=temp;}}}for(i=0;i6、udentstuInfo[N];/*定义保存学生信息的数组*/inputInfo(stuInfo);/*执行输入信息函数*/printInfo(stuInfo);/*执行打印输出信息函数*/maxScore(stuInfo);/*执行打印最高分数学生信息函数*/while(1){printf("Input'p'tosort,'q'toquit.");scanf("%c",&keyInput);if(keyInput=='p'7、8、keyInput=='P')sortScore(stuInfo);elseif(keyInput=='q'9、10、keyInput=='11、Q')break;}printf("Thankyou,bye!");getch();}
3、}voidprintInfo(structstudentstu[])/*打印输出信息函数体*/{inti;for(i=0;i4、f(stu[stuMax].fAve5、序法对成绩数组进行排序*/{for(j=N-1;j>=i;j--){if(stu[j].fAve>stu[j-1].fAve){temp=stu[j];stu[j]=stu[j-1];stu[j-1]=temp;}}}for(i=0;i6、udentstuInfo[N];/*定义保存学生信息的数组*/inputInfo(stuInfo);/*执行输入信息函数*/printInfo(stuInfo);/*执行打印输出信息函数*/maxScore(stuInfo);/*执行打印最高分数学生信息函数*/while(1){printf("Input'p'tosort,'q'toquit.");scanf("%c",&keyInput);if(keyInput=='p'7、8、keyInput=='P')sortScore(stuInfo);elseif(keyInput=='q'9、10、keyInput=='11、Q')break;}printf("Thankyou,bye!");getch();}
4、f(stu[stuMax].fAve5、序法对成绩数组进行排序*/{for(j=N-1;j>=i;j--){if(stu[j].fAve>stu[j-1].fAve){temp=stu[j];stu[j]=stu[j-1];stu[j-1]=temp;}}}for(i=0;i6、udentstuInfo[N];/*定义保存学生信息的数组*/inputInfo(stuInfo);/*执行输入信息函数*/printInfo(stuInfo);/*执行打印输出信息函数*/maxScore(stuInfo);/*执行打印最高分数学生信息函数*/while(1){printf("Input'p'tosort,'q'toquit.");scanf("%c",&keyInput);if(keyInput=='p'7、8、keyInput=='P')sortScore(stuInfo);elseif(keyInput=='q'9、10、keyInput=='11、Q')break;}printf("Thankyou,bye!");getch();}
5、序法对成绩数组进行排序*/{for(j=N-1;j>=i;j--){if(stu[j].fAve>stu[j-1].fAve){temp=stu[j];stu[j]=stu[j-1];stu[j-1]=temp;}}}for(i=0;i6、udentstuInfo[N];/*定义保存学生信息的数组*/inputInfo(stuInfo);/*执行输入信息函数*/printInfo(stuInfo);/*执行打印输出信息函数*/maxScore(stuInfo);/*执行打印最高分数学生信息函数*/while(1){printf("Input'p'tosort,'q'toquit.");scanf("%c",&keyInput);if(keyInput=='p'7、8、keyInput=='P')sortScore(stuInfo);elseif(keyInput=='q'9、10、keyInput=='11、Q')break;}printf("Thankyou,bye!");getch();}
6、udentstuInfo[N];/*定义保存学生信息的数组*/inputInfo(stuInfo);/*执行输入信息函数*/printInfo(stuInfo);/*执行打印输出信息函数*/maxScore(stuInfo);/*执行打印最高分数学生信息函数*/while(1){printf("Input'p'tosort,'q'toquit.");scanf("%c",&keyInput);if(keyInput=='p'
7、
8、keyInput=='P')sortScore(stuInfo);elseif(keyInput=='q'
9、
10、keyInput=='
11、Q')break;}printf("Thankyou,bye!");getch();}
此文档下载收益归作者所有