已采纳回答 / 窗天云乡思
%s是字符串的输出,给你举个例子吧printf函数的一般使用形式为:printf("输出格式",输出项系列);要输出字符串,则只需写出相应的输出格式以及输出项系列即可,其中输出格式为%s,输出项系列为字符串名printf函数输出字符串的例子如下:#include<stdio.h>void main(){ char str[10]="ABCD";printf("%s",str);}上述程序输出了字符串 ABCD如果输出的只是一串字的话,就例如这道题,就不用写%s了
2017-04-16
已采纳回答 / 么么哒萌萌哒
#include<stdio.h>main(){ int n=0,m=0,k; while(n<100) { n++; if(n%2==0) { k=-n; } else { k=n; } m=m+k; } printf("%d",m);}
2017-04-15
已采纳回答 / 虚伪的笑容
#include <stdio.h>
int main()
{
int score = 5201314;
//完善一下代码
if (score>=100000)
{
printf("神级玩家");
}
else if (score>=10000)
{
printf("钻石玩家");
}
else if (score>=5000)
{
printf("...
2017-04-14
已采纳回答 / rpg2
#include <stdio.h>int main() { int score = 87; //考试分数为87分 score/=10; switch(score) { /*想想以下代码为什么用这种方式; 这种方式的好处?*/ case 10: case 9: printf("等级A"); break; case 8: print...
2017-04-13
已采纳回答 / 虚伪的笑容
sum=sum+i*flag; //这是赋值给sum
flag=flag*(-1); //这是正负号的变换,如:1,-1, 1,-1........就这样一直到编程结束
2017-04-12