解题思路:

注意事项:

参考代码:

#include<stdio.h>

int main()

{

    int a[50],i=0;

    int count1=0,count2=0,count3=0;

    while(scanf("%d",&a[i]))//录入成绩数据

    {

        if(a[i]>0)

        {

            ++i;

        }

        else

        {

            break;

        }

    }

    i=0;

    while(a[i]!=0)//统计数据

    {

        if(a[i]>=85)

            ++count1;

        else if(a[i]>=60&&a[i]<=84)

            ++count2;

        else if(a[i]<60)

            ++count3;

        ++i;

    }

    printf(">=85:%d\n60-84:%d\n<60:%d",count1,count2,count3);

    return 0;

}


 

0.0分

0 人评分

  评论区

  • «
  • »