#include#include main (){\x05double a=7,x=2.8,y=4.6,m=0;m=x+a%3*(int)(x+y)%2/4-6;printf("%f,%f,%f,%f,%f\n",a,x,y,m);return 0;}哪里出错了?写个正确的

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/28 17:41:07
#include#include main (){\x05double a=7,x=2.8,y=4.6,m=0;m=x+a%3*(int)(x+y)%2/4-6;printf(
x)SK)MI y 1)I9 :Fz:&zf:ֹډZy%ڕF&fE@4 %4$SSi]ZRZ``]t=Ow2ɮ6m3Xl =bTw! G̮̃\ х`Y"VW & yGf(9P'<_ٌ@ۗ=dgS7

#include#include main (){\x05double a=7,x=2.8,y=4.6,m=0;m=x+a%3*(int)(x+y)%2/4-6;printf("%f,%f,%f,%f,%f\n",a,x,y,m);return 0;}哪里出错了?写个正确的
#include
#include
main ()
{
\x05double a=7,x=2.8,y=4.6,m=0;
m=x+a%3*(int)(x+y)%2/4-6;
printf("%f,%f,%f,%f,%f\n",a,x,y,m);
return 0;
}
哪里出错了?写个正确的

#include#include main (){\x05double a=7,x=2.8,y=4.6,m=0;m=x+a%3*(int)(x+y)%2/4-6;printf("%f,%f,%f,%f,%f\n",a,x,y,m);return 0;}哪里出错了?写个正确的
错误提示是%的左操作数不能是double型,改成下面这样:
m=x+(int)a%3*(int)(x+y)%2/4-6;