課程
/后端開發(fā)
/C
/C語言入門
需要編一個(gè)程序, 要使它運(yùn)行的時(shí)候輸入分?jǐn)?shù)會(huì)彈出等級(jí)
2016-10-05
源自:C語言入門 4-3
正在回答
else沒有判斷功能,你在else 后加括號(hào)也沒用
#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;
}
#include<stdio.h>
int main ( )
int score=?????; //自己輸入分?jǐn)?shù)……
if(score……)
printf("等級(jí)……");
else if (score……)
…………
else
return 0
LOG5NM4107811
舉報(bào)
C語言入門視頻教程,帶你進(jìn)入編程世界的必修課-C語言
1 回答if-else語句
1 回答if else語句
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)
2016-11-02
else沒有判斷功能,你在else 后加括號(hào)也沒用
2016-10-22
#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-10-05
#include<stdio.h>
int main ( )
{
int score=?????; //自己輸入分?jǐn)?shù)……
if(score……)
{
printf("等級(jí)……");
}
else if (score……)
{
}
…………
else
{
}
return 0
}