... ...
aveAge = aveAge/N;
aveScore = aveScore/N;
printf("Average Age:%lf\tAverage Score:%lf\n", aveAge, aveScore);
/*统计各个分数段的人数,各成绩段学生人数的分布情况类似*/
for(p = stu; p < stu+N; p++)
{
if(p->score >= 90)
scoreCnt[0]++;
else if(p->score >= 80)
scoreCnt[1]++;
else if(p->score >= 70)
scoreCnt[2]++;
else if(p->score >= 60)
scoreCnt[3]++;
else
scoreCnt[4]++;
}
for(i = 0; i < 5; i++)
{
if(i < 4)
printf("The number of the people below %d:\t%d\n", 90-10*i,scoreCnt[i]);
else
printf("The bumber of the people below 60:\t%d\n",scoreCnt[i]);
}
return 0;
}
我E语学的也不太好,凑合着看吧