printf的输出问题
#include<stdio.h>int main()
{
int a, b;
double c = 0.0;
scanf("%d %d", &a, &b);
printf("input two numbers \n");
printf("%d + %d = %d\n", a, b, a + b);
printf("%d - %d = %d\n", a, b, a - b);
printf("%d * %d = %d\n", a, b, a * b);
c = a * 1.0 / (b *1.0);
if (a % b == 0)
{
printf("%d / %d = %.f\n", a, b, c);
}
else
{
printf("%d / %d = %.2f\n", a, b, c);
}
return 0;
}
我想问为什么
printf("%d + %d = %d\n", a, b, a + b);
printf("%d - %d = %d\n", a, b, a - b);
printf("%d * %d = %d\n", a, b, a * b);
上面这三条为什么不会打印在终端上,而printf("input two numbers \n");这条会打印在终端上? ???? 一世轻尘 发表于 2020-12-17 23:13
????
.... 我犯傻了,突然明白了
页:
[1]