哪錯(cuò)了啊?
#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;
}
2021-01-13
#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;
}
2021-01-09
要不去掉else,不然就改else if()的判斷條件,如else if(score>=5000&&score<10000)改為else if(score>=5000),因?yàn)榈谝粋€(gè)if(score>=10000)后的else if()的判斷條件取值范圍就是score>=10000取反范圍score<10000。而且最后一個(gè)分支只需要else就行。
2020-12-16
你應(yīng)該輸?shù)氖侵形姆睦ㄌ?hào)
2020-12-02
if(score>=10000)? 這一句? 括號(hào) 的格式不對(duì)