為什么別人成功的都是最后一個(gè)只有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<5000)? ??
? ? {
? ? ? ? printf("青銅玩家");? ? ?
? ? }
else if(score<1000)??
? ? {
? ? ? ? printf("普通玩家");? ??
? ? }
? ? return 0;
}
2018-09-23
#include<stdio.h>
int main()
{
??? int score = 7200;
??? if(score >= 10000)
??? {
??????? printf("鉆石玩家");
??? }
??? else if(5000 <= score)
??? {
??????? printf("白金玩家");
??? }
??? else if(1000 <= score)
??? {
??????? printf("青銅玩家");
??? }
??? else
??? {
??????? printf("普通玩家");
??? }
??? return 0;
???
}
2018-09-16
首先,你不成功是因?yàn)榘?amp;&打成%%;其次,最后一個(gè)既可以用else,也能用else if
你應(yīng)該這樣改
else if(score>=1000%%score<5000) 改為else if(score>=1000&&score<5000)
else if(score>=5000%%score<10000) 改為else if(score>=5000&&score<10000)
然后就可以了。
2018-09-16
首先,你不成功是因?yàn)榘?amp;&打成%%;其次,最后一個(gè)可以用else,也能用else if