大神看一下我這個(gè)代碼哪里錯(cuò)了
#include <stdio.h>
int main()?
{
? ? int score = 7200;
? if(score>=10000)??
? ? {
? ? ? ? printf("鉆石玩家");
? ? }
? ? else if(score>=5000)
? ? {
? ? ? ? printf("白金玩家");? ??
? ? }
? ? else if(score>=1000)
? ? {
? ? ? ? printf("青銅玩家");? ? ?
? ? }
? else(score<1000)
? ? {
? ? ? ? printf("普通玩家");? ??
? ? }
? ? return 0;
}
2019-09-24
2019-07-10
你好,你代碼里面最后一個(gè)分支忘了寫if,應(yīng)該寫成else if:
另外,從邏輯分析,這里的 score<1000條件是完全沒必要的,可以直接寫成這樣:
else
??
2019-07-07
最后一個(gè)else后括號(hào)刪掉就行
2019-07-06
按照你的代碼,10001滿足鉆石,白金,青銅。。。在條件那兒還有加上限,例如else if(score<10000&&score>=5000)是白金玩家的評(píng)定標(biāo)準(zhǔn)