這里的%s是怎么用的?
#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
? ? {
? ? ? ? printf("%s\n","普通玩家"); ? ?
? ? }
? ? return 0;
}
2017-07-23
因?yàn)?白金玩家"是一個(gè)字符串 所以打印時(shí)要用%s
2017-07-24
%s在輸出字符串時(shí)使用
\n是換行符
2017-07-23
要輸出字符串,所以用%s