C语言学生系统典例.docVIP

  • 1
  • 0
  • 约2.65万字
  • 约 28页
  • 2017-09-09 发布于江苏
  • 举报
学完了C语言,遍了4个学生管理系统的程序 感觉有点儿意思,不过还真的有价值 现在拿出来给大家看看: 一. 某班有最多不超过 30 人(具体人数由键盘输入)参加某门课程的考试,参考例 6.2 、例 6.4 、例 6.5 ,用一维数组作函数参数编程实现如下学生成绩管理: ( 1 ) 录入学生的人数; ?????????? **要求输入提示信息为:Please input total number:\n ?????????? **要求输入数据格式为:%d ( 2 )录入每个学生的学号和考试成绩; ????????? **要求输入提示信息为:Please enter the number and score:\n ????????? **要求输入数据格式为:%ld,%f ( 3 )计算课程的总分和平均分; ????????? **要求输出总分格式为:The total score is: %d\n ????????? **要求输出平均分格式为:The average score is: %d\n ( 4 )按成绩由高到低排出名次表; ???????? **要求输出提示信息为:Sorted result as score decreasing:\n ???????? **要求输出格式为:%ld,%4.0f\n ( 5 )按学号由小到大排出成绩表; ???????? **要求输出提示信息为:Sorted result as number increasing:\n ???????? **要求输出格式为:%ld,%4.0f\n ( 6 )按学号查询学生排名及其考试成绩; ???????? 提示信息:Please input the number you want to search:\n ???????? **如果未查到此学号的学生,提示信息为:The number you input is not exist!\n ???????? **如果查询到该学生,要求输出格式为:The ranking of number %ld is %d, and the score is %4.0f\n ( 7 )按优秀( 90~100 )、良好( 80~89 )、中等( 70~79 )、及格( 60~69 )、不及格( 0~59 ) 5 个类别,统计每个类别的人数以及所占的百分比; ??????? **要求输出提示信息为:perfect\t\tgood\t\tmedium\t\tpass\t\tfail\n ??????? **要求输出人数格式为:%.0f\t\t%.0f\t\t%.0f\t\t%.0f\t\t%.0f\n ??????? **要求输出百分比格式为:%.2f%%\t\t%.2f%%\t\t%.2f%%\t\t%.2f%%\t\t%.2f%%\n ( 8 )输出每个学生的学号、考试成绩,以及课程总分和平均分。 ??????? **要求输出提示信息为:All the numbers and scores are below:\n ??????? **要求输出成绩格式为:%ld,%4.0f\n ??????? **要求输出总分格式为:The total score is: %d\n ??????? **要求输出平均分格式为:The average score is: %d\n #include? stdio.h #define ARR_SIZE 30 ?? void sort(float score[],long num[],int n); void SS(float score[],long num[],int n); int Sea(long num[],int n,long x); ?? int main() { ????float a=0,b=0,c=0,d=0,e=0,score[ARR_SIZE]; ????int n,pos,i,temp,totalscore=0,averagescore; ????long num[ARR_SIZE],x; ????printf(Please input total number:\n); ????scanf(%d,n); ?? ????printf(Please enter the number and score:\n); ????for(i=0;in;i++) ????{ ????????scanf(%ld,%f,num[i],score[i]); ????} ?? ????for(i=0;in;i++) ????{ ????????totalscore=totalscore+score[i]; ????} ?? ????p

文档评论(0)

1亿VIP精品文档

相关文档