为什么第十行是错的啊?
5000<=score<10000
和
score>5000&&score<10000
有区别吗,哪个对啊?
//复原一下你的答案。如下。
#include <stdio.h>
int main()
{
int score = 7200;
{
if(score>=10000)
printf("钻石玩家");
}
else if(score>=5000) //这一句错了哦,else if前面没有if语句。之前的{if语句}在{}内。
{
printf("白金玩家");
}
else if(score>=1000)
{
printf("青铜玩家");
}
return 0;
}
//以下是正确答案
#include <stdio.h>
int main()
{
int score = 7200; //完善一下代码
if(score>=10000)
printf("钻石玩家");
else if(score>=5000)
printf("白金玩家");
else if(score>=1000)
printf("青铜玩家");
return 0; // int main(),需要一个返回值
}
// int main(),需要一个返回值#include <stdio.h>
int main()
{
int score = 7200; //完善一下代码
if(score>=10000)
printf("钻石玩家");
else if(score>=5000)
printf("白金玩家");
else if(score>=1000)
printf("青铜玩家");
return 0; // int main(),需要一个返回值
}
// int main(),需要一个返回值