判断偶数:

判断偶数:

a%2!=1(不要使用a%2==0,因为偶数也有负数的情况)

或者

a&1==0(位运算)

原文地址:https://www.cnblogs.com/saifei1125/p/12930279.html