标题:switch语句
取消只看楼主
plane5530
Rank: 1
等 级:新手上路
帖 子:76
专家分:0
注 册:2007-1-19
结帖率:83.33%
已结贴  问题点数:10 回复次数:0 
switch语句
下面的语句为什么执行起来老不成功啊?检查了好几次了,没检查出来什么问题。
main()
{int e;float score;char grade;
printf ("please input score:\n");
scanf ("%f",&score);
if (score>100||score<0) {printf ("data is  error\n");  e=1;}
swith (score/10)
{case 10:
 case 9: grade='A';break;
 case 8: grade='B';break;
 case 7: grade='C';break;
 case 6: grade='D';break;
 case 5:
 case 4:
 case 3:
 case 2:
 case 1:
 case 0: grade='E';break;}
 if (e==0) printf ("result is %f,grade is %c\n",score,grade);
 getch();}
搜索更多相关主题的帖子: 检查 please result 
2011-04-21 14:03



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-337437-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.541756 second(s), 10 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved