到底哪里出錯(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(score<1000)
? ? {
? ? ? ? printf("普通玩家");? ??
? ? }
? ? return 0;
}
2020-11-21
if else多分支,最后一個(gè)else可以看做是未滿足前面其他分支條件的默認(rèn)情況,而else(score<1000),給定了條件。你可以看是要去掉最后一個(gè)條件作默認(rèn),還是else后加個(gè)if給定一個(gè)條件。