|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
#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");这条会打印在终端上?
|
|