“讨债”的“%d”
要让 printf()输出变量的值,不能用以下方法:
printf("c");
这样只能输出字符c。
应该利用”%c“,输出 整型变量c的值:
printf("%d",c);
计算a+b,并输出的完整过程
#include <stdio.h>
#include <stulib.h>
int main()
{
int a,b,c;
a=1;
b=2;
c=a+b;
printf("%d",c);
system("pause");
return 0;
}