課程
/后端開(kāi)發(fā)
/C
/C語(yǔ)言入門
麻煩大家?guī)臀铱纯戳?
2019-10-01
源自:C語(yǔ)言入門 4-3
正在回答
#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?
? ? ? ? printf("普通玩家");? ??
? ? return 0;
}
誰(shuí)說(shuō)加上邏輯符號(hào)不行
你是第三個(gè)打成了else,這個(gè)結(jié)構(gòu)只有最后才能打else的
最后一個(gè)else不判斷,直接執(zhí)行{}內(nèi)的內(nèi)容,不能在else后面補(bǔ)()
else if
把邏輯或去了
? ? if(score>=10000)
? ? else if(score>=5000)
? ? else if(score>=1000)
? ? else
沒(méi)你那么復(fù)雜
慕沐4317455
拉風(fēng)的鯤 回復(fù) 慕沐4317455
Pouringrain_ 回復(fù) 慕沐4317455
舉報(bào)
C語(yǔ)言入門視頻教程,帶你進(jìn)入編程世界的必修課-C語(yǔ)言
5 回答為什么我會(huì)hello.c運(yùn)行失敗
1 回答請(qǐng)指點(diǎn)hello.c運(yùn)行失敗
1 回答hello.c運(yùn)行失敗
4 回答hello.c運(yùn)行失敗
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2019-10-05
#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?
? ? {
? ? ? ? printf("普通玩家");? ??
? ? }
? ? return 0;
}
誰(shuí)說(shuō)加上邏輯符號(hào)不行
你是第三個(gè)打成了else,這個(gè)結(jié)構(gòu)只有最后才能打else的
2019-10-08
最后一個(gè)else不判斷,直接執(zhí)行{}內(nèi)的內(nèi)容,不能在else后面補(bǔ)()
2019-10-05
else if
2019-10-02
把邏輯或去了
#include <stdio.h>
int main()?
{
? ? int score = 7200;
? ? //完善一下代碼
? ? if(score>=10000)
? ? {
? ? ? ? printf("鉆石玩家");
? ? }
? ? else if(score>=5000)
? ? {
? ? ? ? printf("白金玩家");? ??
? ? }
? ? else if(score>=1000)
? ? {
? ? ? ? printf("青銅玩家");? ? ?
? ? }
? ? else
? ? {
? ? ? ? printf("普通玩家");? ??
? ? }
? ? return 0;
}
沒(méi)你那么復(fù)雜