switch的用法
程序是这样的 main()
{
int num;
char grade;
printf("Please input score\n");
scanf("%d",&num);
num/=10;
switch(num)
{
case 10:
case 9:
grade='A';
break;
case 8:
grade='B';
break;
case 7:
grade='C';
break;
case 6:
grade='D';
break;
default:
grade='E';
break;
}
printf("%c\n",grade);
}
switch不是不能用浮点数吗?怎么我输入96.5运行结果还是为A呢