15.若有定义: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的值是( )
答
按从左到右结合律计算,优先顺序,求余-〉乘法,除法-〉加法
a%3=1
(int)(x+y)=7
1*7=7
7%2=1
1/4=0
x+0=2.5