问题
思路
换底公式即可。
代码
class Solution {
public:
bool isPowerOfFour(int num) {
double tmp = log10(num)/log10(4);
return tmp == (int)tmp;
}
};
换底公式即可。
class Solution {
public:
bool isPowerOfFour(int num) {
double tmp = log10(num)/log10(4);
return tmp == (int)tmp;
}
};