#leetcode231

leetcode231 2的幂 leetcode342 4的幂 leetcode326 3的幂

1.2的幂正确写法:classSolution{public:boolisPowerOfTwo(intn){if(n<=0)returnfalse;return(n&(n-1))==0;}};错误写法1:&符号的短路原则,如果&前面为false了就不会计算后面的了classSolution...