c语言,为什么没有输出字母?

如题所述

第1个回答  2019-04-17
if(score >= 70 && score < 75)

第2个回答  2019-04-17

这个程序中,第六行和第13行,第15行都错了。
因为其中涉及到一个75分。所以,如果用switch语句来做的话,应该用除以5的结果来进行分类。所以这个题目如果没有规定必须要用多分支语句来做的话,使用if和else反而来的方便。
#include "stdio.h"
int main()
{ int score;
scanf("%d",&score);
if(score<60)printf("E\n");
else if(score<70)printf("D\n");
else if(score<75)printf("Error\n");
else if(score<80)printf("C\n");
else if(score<90)printf("B\n");
else printf("A\n");
return 0;
}

本回答被提问者采纳

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网