為什么最后的else后面不能加東西
#include <stdio.h>
int main()?
{
? ? int score = 7200;
? ? //完善一下代碼
? ? if( score>=10000)
? ? {
? ? ? ? printf("%s\n","鉆石玩家");
? ? }
? ? else if(score<10000)
? ? {
? ? ? ? printf("%s\n","白金玩家");? ??
? ? }
? ? else if(score<5000)
? ? {
? ? ? ? printf("%s\n","青銅玩家");? ? ?
? ? }
? ? else
? ? {
? ? ? ? printf("%s\n","普通玩家");? ??
? ? }
? ? return 0;
}
2020-09-04
if代表是如果的意思,else是否則的意思,else if? 中的else是上一個if的結尾可以這樣理解,所以else是結束了。