LeetCode 326. Power of Three

题目

class Solution {
public:
    bool isPowerOfThree(int n) {
    
    double x = log10(n) / log10(3);

        return  n>0 && (abs((int)x - x) < 0.000000000000001);
    }
};
原文地址:https://www.cnblogs.com/dacc123/p/13273926.html