int m = 5;
int n = 7;
int x = (m*8/(n+2))%m;
System.out.println("m:" + m);
System.out.println("n:" + n);
System.out.println("x:" + x);
你们不要误导人啊,%是取模,也就是求余数,40除以9的余数是4,但是巧合是商也是4,麻烦你们不要搞混淆了
(5*8/(7+2))%5
(40/9)%5=4.4444444
然后int接收就变成4了
n+2=9
m*8=40
40/9 只要整数4
4%5=4