大一,深夜发帖求问
求各位解惑
```c
#include
#include
#include
int main()
{ double x;
int y,t;
scanf("%lf %d",&x,&y);
if(x<=3.0)
printf("%d",y/52+10);
if(3.0
{
x=round(2.0x+4+y/52);
printf("%d",(int)x);\结果应是14,却出现了1436
}
if(x>10.0)
{
x=round(3.0x-6+y/5*2);
printf("%d",(int)x);
}
return 0;
}
```运行时发现在3
即
```c
if(3.0
{
x=round(2.0x+4+y/52);
printf("%lf",x);\结果为14.000036,为合理答案
}
```便得到了正确的的浮点数,但在强制后却出现了错误
求各位评论,求同为**的大家讨论
x 是double 要用%f输出,不是%d,%d只能输出整形的