leetcode 326
3的幂
1 class Solution { 2 public: 3 bool isPowerOfThree(int n) { 4 double k; 5 k=log10(n)/log10(3); 6 if((int)k==k) 7 return true; 8 return false; 9 } 10 };
3的幂
1 class Solution { 2 public: 3 bool isPowerOfThree(int n) { 4 double k; 5 k=log10(n)/log10(3); 6 if((int)k==k) 7 return true; 8 return false; 9 } 10 };