Java中算法
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);
为何x输出为4?
x=5*8/(7+2)%5
=40/9%5
=4%5
=0
不对吗?望指点迷津...
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);
为何x输出为4?
x=5*8/(7+2)%5
=40/9%5
=4%5
=0
不对吗?望指点迷津...
2015-08-23
举报