设x=2.5,a=7,y=4.7,求x+a%3*(int)(x+y)%2/4 要说明先算哪步.最好再说说运算符的优先级.
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/10 12:50:17
设x=2.5,a=7,y=4.7,求x+a%3*(int)(x+y)%2/4 要说明先算哪步.最好再说说运算符的优先级.
x+a%3*(int)(x+y)%2/4 //先算(int)(x+y),x+y取整得7
=x+a%3*7%2/4 //算a%3=1
=x+1*7%2/4 //算1*7=7
=x+7%2/4 //算7%2=1
=x+1/4 //算1/4=0
=x+0
=2.5
再问: 为什么我这么打输出来的是2.000000 main(){ int x=2.5,a=7,y=4.7; float h; h=x+a%3*(int)(x+y)%2/4; printf("%f\n",h); }
再答: /int x=2.5,a=7,y=4.7;//请问x,与y是整数吗? //下面是测试程序 #include int main(void) { float x=2.5,y=4.7; float h; int a=7; h=x+a%3*(int)(x+y)%2/4; printf("%f\n",h); return 0; }
=x+a%3*7%2/4 //算a%3=1
=x+1*7%2/4 //算1*7=7
=x+7%2/4 //算7%2=1
=x+1/4 //算1/4=0
=x+0
=2.5
再问: 为什么我这么打输出来的是2.000000 main(){ int x=2.5,a=7,y=4.7; float h; h=x+a%3*(int)(x+y)%2/4; printf("%f\n",h); }
再答: /int x=2.5,a=7,y=4.7;//请问x,与y是整数吗? //下面是测试程序 #include int main(void) { float x=2.5,y=4.7; float h; int a=7; h=x+a%3*(int)(x+y)%2/4; printf("%f\n",h); return 0; }
求算术表达式x+a%3*(int)(x+y)%2/4的值,设x=2.5,a=7,y=4.7中a%3*(int)(x+y)
x+a%3*(int)(x+y)%2/4 设x=2.5 a=7 y=4.7
设X=2.5,a=7,y=4.7,表达式x+a%3*(int)(x+y)%2/4的值是?
C语言中的算数表达式设x=2.5,a=7,y=4.7 则x+a%3*(int)(x+y)%2/4的值为多少?
vb 算数运算x=2.5 a=7 y=4.7 求 x+aMod3*(Int(x+y)Mod2)/4 为什么结果是2 先算
(float)(a+b)/2+(int)x%(int)y 设a=2,b=3,x=3.5,y=2.5 求算术表达式的值
已知:a=7,x=2.5,y=4.7(a整型,x,y浮点),计算算术表达式x+a%3*(int)(x+y)%2/4的值.
设x=2.5 a=7 c=4.7,算术表达式x+a%3*(int)(x+y)%2/4的值是?
int a=7;float x=2.5,y=4.7 x+a%3*(int)(x+y)%2\4的值为什么等于2.5
若有定义:int a=7;float x=2.5,y=4.7; ,则表达式x+a%3*(int)(x+y)%2/4的值是
若有定义“int a=7;float x=2.5,y=4.7;”,则表达式x+a%3*(int)(x+y)%2/4的值是
15.若有定义:int a=7;float x=2.5,y=4.7;则表达式x+a%3*(int)(x+y)%2/4的值