请帮忙看看这段程序怎么理解!
#include<iostream.h>void main()
{
int score,s,sum;
char grade;
cout<<"please input score "<<endl;
cin>>score;
if(score>=0&&score<=100)
{
s=score/10;
switch(s)
{
case 0:
case 1:
case 2:
case 3:
case 4:
case 5: grade='2';break;
case 6:
case 7: grade='3';break;
case 8: grade='4';break;
case 9:
case 10: grade='5';break;
}
cout<<"grade is "<<grade<<endl;
}
else
cout<<"data error\n";
}
这是一个把百分制成绩按照五分制输出的程序,用switch写的!可是我不太明白case那段代码。比如我输入20,为什么也显示2,输入30也显示2!请知道的解释下具体原因!