慕村9610777
2015-09-18 18:40
顺带问一下,这个语句的输出为啥不用加%s\n?
#include <stdio.h>
int main()
{
int score = 7200;
if(score >=10000)//完善一下代码
{
printf("钻石玩家");
}
else if(score >= 5000)
{
printf("白金玩家");
}
else if(score >=1000)
{
printf("青铜玩家");
}
else()
{
printf("普通玩家");
}
return 0;
}
%s是字符串的输出吧
最后一个判断语句中没有条件吧。
如果你想用%s来挖坑进行输出的话,可以按照1楼的说法来试一下。用string类型的。
你可以自己定义一个字符串类型的变量string,然后用printf("%s",string);输出
C语言入门
928176 学习 · 21543 问题
相似问题