逆水中的鱼
2015-07-27 17:11
4-3 分支结构之多重if-else语句
可爱的小弟呀,你知道{}这个大括号是什么用吗?是用来表示满足if()的条件要执行的语句。所以if,else if应该放在它外面,所以答案是这样的:
#include <stdio.h>
int main()
{
int score = 7200;
//完善一下代码
if(score>=10000)
{
printf("钻石玩家");
}
else if(score>=5000&&score<10000)
{
printf("白金玩家");
}
else if(score>=1000&&score<10000)
{
printf("青铜玩家");
}
else if(score<1000)
{
printf("普通玩家");
}
return 0;
}
C语言入门
926348 学习 · 20799 问题
相似问题