题目描述
编写程序,输入一批学生的成绩,遇0或负数则输入结束,要求统计并输出优秀(大于85)、通过(60~84)和不及格(小于60)的学生人数。
样例输入
88 71 68 70 59 81 91 42 66 77 83 0
样例输出
=85:2
60-84:7
<60:2
```c
#include<stdio.h>
int main()
{
int a=0, b=0, c=0;
int score[20];
for(int i=0;i<20;i++)
{
scanf("%d",&score[i]);
if(score[i]>=85)
a++;
else if(score[i]<60&&score[i]>0)
c++;
else if(score[i]>=60&&score[i]<85)
b++;
}
printf(">=85:%d\n60-84:%d\n<60:%d\n",a,b,c);
return 0;
}
哪里错了吗结果出不来