class Solution {
public:
bool isPowerOfThree(int n) {
double x = log10(n) / log10(3);
return n>0 && (abs((int)x - x) < 0.000000000000001);
}
};
class Solution {
public:
bool isPowerOfThree(int n) {
double x = log10(n) / log10(3);
return n>0 && (abs((int)x - x) < 0.000000000000001);
}
};