Leetcode 231 Power of Two 数论
同样是判断数是否是2的n次幂,同 Power of three
1 class Solution { 2 public: 3 bool isPowerOfTwo(int n) { 4 return (n > 0) && (((long long)1<<31) % n == 0); 5 } 6 };
同样是判断数是否是2的n次幂,同 Power of three
1 class Solution { 2 public: 3 bool isPowerOfTwo(int n) { 4 return (n > 0) && (((long long)1<<31) % n == 0); 5 } 6 };