#include<iostream>
using namespace std;
int main()
{
float cj;
int count[6]={0};
while(1)
{
cin >>cj;
if(cj<0)
{
break;
}
switch((int)cj/10)
{
case 10:
{
count[5]++;
break;
}
case 9:
{
count[4]++;
break;
}
case 8:
{
count[3]++;
break;
}
case 7:
{
count[2]++;
break;
}
case 6:
{
count[1]++;
break;
}
default:
{
count[0]++;
break;
}
}
}
for(int i=0;i<6;i++)
{
cout <<count[i]<<" ";
}
cout <<endl;
return 0;
}分数统计
原文:http://blog.csdn.net/cq1042713261/article/details/45251819