|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
#include <stdio.h>
void main()
{
int s;
printf(" 请输入分数score:");
scanf("%d\n",&s);
if (s <60)
{
printf("E\n");
}
else if ( (s >60 || s ==60 ) && s <70)
{
printf("D\n");
}
else if ( (s >70 || s ==70 ) && s <80)
{
printf("C\n");
}
else if ( (s >80 || s ==80 )&& s <90)
{
printf("B\n");
}
else
{
printf("A\n");
}
}
错误在注释中已经标明
- #include <stdio.h>
- void main()
- {
- int s;
- printf("请输入分数score:");
- scanf("%d",&s); // 错误在此处,除控制符外,不要添加任何其他字符,你添加了一个回车
-
- if (s < 60)
- {
- printf("E\n");
- }
- else if (s >= 60 && s < 70)
- {
- printf("D\n");
- }
- else if (s >= 70 && s < 80)
- {
- printf("C\n");
- }
- else if (s >= 80 && s < 90)
- {
- printf("B\n");
- }
- else
- {
- printf("A\n");
- }
- }
复制代码
|
|