程序编写请各位大侠来帮忙,拜谢了(急求)

2024-12-29 04:06:34
推荐回答(1个)
回答1:

/*
demo.c -- stat
输入十个学生成绩,要求统计出及格人数和不及格人数。
*/
#include "stdio.h"
int main()
{
float achievement[10];
int qualification,disqualification;
int i;
printf("Enter student achievement(10):\n");
qualification=0;
disqualification=0;
for(i=0;i<10;i++)
{
scanf("%f",&achievement[i]);
if(achievement[i]<60.0)
disqualification++;
else
qualification++;

}
printf("qualification number:%d\ndisqualification number:%d\n",qualification,disqualification);
getch();
}