问答详情
源自:3-8 Java中运算符的优先级
int x = ( m * 8 / ( n + 2 ) ) % m ;
int x = ( m * 8 % ( n + 2 ) )
m=5
n=7
x=4
这样才正确吧
提问者:慕盖茨3434532
2021-08-14 17:47
个回答
慕瓜8049783
2021-08-15 10:04:22
(n+2)优先运算,n+2=9;
m*8/9=4.4444444....
4%5=4,所以最后应该是4
0