源码简介: |
定义学生结构体,包含“学号、姓名、三门课成绩、平均成绩”等信息,利用该结构体存储,期中考试中每个同学高等数学、大学英语、程序设计基础三门课的成绩,利用函数进行如下信息统计,学生人数30人,所有学生的成绩采用随机生成,每门课的成绩为[40,100]之间的随机数。数据的初始化采用自定义的initData函数实现,分别编写studentAve函数求每个学生平均分的从高到低输出学生的成绩,一个学生一行;courseAve函数求课程平均分并输出每门课程的平均分;countFail函数统计有不及格学生的人数和不及格人次数,并输出这两项数据。-Define students structure that contains the student number, the name, the achievements of three courses, grade point average, " and other information, the use of the structure is stored, each student advanced mathematics, college English, program design foundation course results in the mid-term exam, function following information statistics, the number of students 30, the achievement of all students using randomly generated, the results of each course for a random number between [40,100]. Data initialized using custom initData function to achieve, respectively to write studentAve function evaluation student achievement high to low average output of each student, a student and his party course average and average output per course courseAve function evaluation points countFail function statistics on the number of students do not pass and do not pass on the number and the output of these two data.
|