把运算的结果强制类型转换要怎么做?
#include <stdio.h>
int main()
{
int a,b,c,d;
double result;
int resultOne = (int) result;
a = 8;
b = 2;
c = 2;
d = 4;
result = (a/b*c+d);
printf("%f\n", result);
printf("%d\n", resultOne);
return 0;
}
//printf("%d\n", resultOne);打印出来的是0