private boolean isOdd ( int i );
不限正数和负数啊
求大佬指教
1
mightofcode 2020-04-27 10:18:26 +08:00
return Math.abs(i)%2==1;
|
2
jzmws 2020-04-27 10:18:42 +08:00
i % 2==0
|
3
JerryCha 2020-04-27 10:22:11 +08:00
return i&1==1;
|
4
shucc 2020-04-27 10:28:49 +08:00
return (num & 1) == 1;
|
5
crayygy 2020-04-27 10:29:52 +08:00 via iPhone 1
看二进制的最后一位
|
9
luxinfl OP |
10
yukiloh 2020-04-27 10:46:33 +08:00 via Android
位判断的亮了
|
11
hunter2015 2020-04-27 10:58:42 +08:00
我似乎只能说,NB
|
12
luxinfl OP 这就叫差距啊
|
13
zllmath 2020-04-27 11:10:06 +08:00 1
|
14
ericls 2020-04-27 11:12:02 +08:00 via iPhone
编译器说: 你以为你很聪明?
|
16
cloudfstrife 2020-04-27 21:17:48 +08:00 via Android
@shucc 这个就叫专业
|