https://leetcode.com/problems/power-of-three/description/
感觉这题有点那啥了....
后面一种写法int - double == 0 这个挺危险的。。。
class Solution {
public:
bool isPowerOfThree(int n) {
// return (n > 0 && 1162261467 % n == 0);
return (n > 0 && int(log10(n)/log10(3)) - log10(n)/log10(3) == 0 );
}
};