#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/17 05:21:18
#include#includemain(){\x05doublea=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

#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;