C程序的问题~~

[复制链接]
查看11 | 回复2 | 2008-5-12 18:42:46 | 显示全部楼层 |阅读模式
每个case没有加break;case 10: case 9:printf("\nA");break;case 8:printf("\nB"); break;case 7:printf("\nC"); break;case 6:printf("\nD"); break;default:printf("\nE"); break;
回复

使用道具 举报

千问 | 2008-5-12 18:42:46 | 显示全部楼层
#include main() {int score; printf("\n score=?"); scanf("%d",&score); switch(score/10) {case 10:
/少了break/ case 9:printf("\nA"); /少了break/case 8:printf("\nB"); /少了break/case 7:printf("\nC"); /少了break/case 6:printf("\nD"); /少了break/default:printf("\nE");
回复

使用道具 举报

千问 | 2008-5-12 18:42:46 | 显示全部楼层
缺少BREAK
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行