> 其他 >
若有定义:int a=7;float x=2.5,y=4.7;则表达式x+a%3*(int)(x+y)%2/4的值是?
人气:383 ℃ 时间: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
考查运算符以及类型转换.
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版