Given an integer, write a function to determine if it is a power of two.
2的幂数二进制只有一个1
1 bool isPowerOfTwo(int n) { 2 if(n <= 0) 3 return 0; 4 return (n & (n-1)) == 0; 5 }