若有定义:int a=7;float x=2.5,y=4.7;则表达式x+a%3*(int)(x+y)%2/4的值是?
人气:326 ℃ 时间:2020-03-24 02:03:47
解答
int a=7;
float x=2.5,y=4.7;
x+a%3*(int)(x+y)%2/4
=> 4.7 + 7 % 3 * (int) ( 2.5+4.7) % 2 / 4
=> 4.7 + 1 * (int) (7.2) % 2 / 4
=> 4.7 + 1 * 7 % 2 / 4
=>4.7 + 1 * 1 / 4
=>4.7 + 0
=>4.7
考查运算符以及类型转换.
推荐
- 15.若有定义: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的值为多少
- 若有定义: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的值是多
- 若有定义:int a=7;float x=2.5,y=4.7;则表达式x+a%3*(int)(x+y)%2/4的值是
- 长江,黄河为什么向东流入大海?
- start for,start out for,start off for,set out for,set off for意思一样吗?
- 定义在R上的偶函数f(x)满足f(x+1)=-f(x),且在[-1,0]上递增,则...f(3)
猜你喜欢