[求助]switch语句
程序代码:
/* Note:Your choice is C IDE */ #include "stdio.h" void main() { int num; char grade; scanf("d",&num); num/=10; switch(num); { case 10: case 9: grade='A'; printf("%c\n",grade); break; case 8: grade='B'; printf("%c\n",grade); break; case 7: grade='C'; printf("%c\n",grade); break; case 6: grade='D'; printf("%c\n",grade); break; default: grade='E'; printf("%c\n",grade); break; } }提示在case 10:出错,查了一些资料,没查出问题。请帮忙看看,告诉我为什么。先谢了
[ 本帖最后由 unxeer 于 2010-10-19 10:52 编辑 ]