#include <stdio.h>
int main()
{
int a,b,c,d;
double result;
a = 1;
b = 2;
c = 3;
d = 4;
result = a + b - c / d; //在这里体验哦~
printf("%f\n", result);
return 0;
}
c和d是int型,所以3/4=0,右边a+b-c/d=3,然后result是double型,发生隐式转换。所以result=3.000000
a+b=3,c/d=0,3-0=3,且%f要求6位小数,所以答案为3.000000