這個有錯嗎?怎么老是說我沒輸出白金玩家
#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 (score < 1000)
? ? {
? ? ? ? printf("普通玩家"); ? ?
? ? }
? ? return 0;
}
2016-03-10
else (score < 1000)這一行else后面不用加判斷語句了,不能這樣寫。
2016-02-28
#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;
}
我是這么寫的 ?你自己對照一下找錯誤 這樣印象深
2016-02-22
else (score < 1000) 改為 if (score < 1000)
2016-02-14
#include <stdio.h>
int main()?
{
? ? int score = 100;
? ? //完善一下代碼
? ? if(score >=10000)
? ? {
? ? ? ? printf("鉆石玩家");
? ? }
? ? else if(score >= 5000 ) //您用?&&加后面的語句其實是多此一舉,
? ? {
? ? ? ? printf("白金玩家"); ? ?
? ? }
? ? else if (score >= 1000)?
? ? {
? ? ? ? printf("青銅玩家"); ? ??
? ? }
? ? else
? ??
? ? ? ? printf("普通玩家"); ? ?
? ??
? ? return 0;
}