課程
/后端開發(fā)
/C
/C語言入門
這怎么錯了啊
2016-05-17
源自:C語言入門 4-3
正在回答
應(yīng)該對的,最后一個else不要加東西
#include <stdio.h>
int main()?
{
? ? int score = 7200;
? ? //完善一下代碼
? ? if(score >= 10000)
? ? {
? ? ? ? printf("%s\n","鉆石玩家");
? ? }
? ? else if(score >= 5000)
? ? ? ? printf("%s\n","白金玩家"); ? ??
? ? else if(score >= 1000)
? ? ? ? printf("%s\n","青銅玩家"); ? ??
? ? else(score < 1000)
? ? ? ? printf("%s\n","普通玩家"); ? ?
? ? return 0;
}
拿白金玩家舉例,else if(score >= 5000<=10000)
睡覺讓我遠離了這世界
舉報
C語言入門視頻教程,帶你進入編程世界的必修課-C語言
1 回答這怎么錯了????
2 回答我這怎么錯了
2 回答這樣怎么錯了
9 回答這個怎么錯了?。。?!
1 回答這樣怎么錯了
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學習伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2016-05-25
應(yīng)該對的,最后一個else不要加東西
#include <stdio.h>
int main()?
{
? ? int score = 7200;
? ? //完善一下代碼
? ? if(score >= 10000)
? ? {
? ? ? ? printf("%s\n","鉆石玩家");
? ? }
? ? else if(score >= 5000)
? ? {
? ? ? ? printf("%s\n","白金玩家"); ? ??
? ? }
? ? else if(score >= 1000)
? ? {
? ? ? ? printf("%s\n","青銅玩家"); ? ??
? ? }
? ? else(score < 1000)
? ? {
? ? ? ? printf("%s\n","普通玩家"); ? ?
? ? }
? ? return 0;
}
2016-05-17
拿白金玩家舉例,else if(score >= 5000<=10000)