課程
/后端開發(fā)
/C
/C語言入門
需要編一個程序, 要使它運行的時候輸入分數(shù)會彈出等級
2016-10-05
源自:C語言入門 4-3
正在回答
else沒有判斷功能,你在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;
}
#include<stdio.h>
int main ( )
int score=?????; //自己輸入分數(shù)……
if(score……)
printf("等級……");
else if (score……)
…………
else
return 0
LOG5NM4107811
舉報
C語言入門視頻教程,帶你進入編程世界的必修課-C語言
1 回答if-else語句
1 回答if else語句
2 回答If-else語句
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2016-11-02
else沒有判斷功能,你在else 后加括號也沒用
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=?????; //自己輸入分數(shù)……
if(score……)
{
printf("等級……");
}
else if (score……)
{
}
…………
else
{
}
return 0
}