【LeetCode 231_整数_位运算】Power of Two

1 bool isPowerOfTwo(int n)
2 {
3     return n > 0 && !(n & (n - 1));
4 }
原文地址:https://www.cnblogs.com/mengwang024/p/4623819.html