n & 1

n&1==0:偶数

n&1!=0:奇数

猜你喜欢

转载自www.cnblogs.com/mcyushao/p/10534792.html