326. Power of Three

 1 static int wing=[](){
 2     std::ios::sync_with_stdio(false);
 3     cin.tie(NULL);
 4     return 0;
 5 }();
 6 
 7 class Solution 
 8 {
 9 public:
10     bool isPowerOfThree(int n) 
11     {
12         return n>0&&(1162261467%n==0);
13     }
14 };

没啥好说的了。

猜你喜欢

转载自www.cnblogs.com/zhuangbijingdeboke/p/9090094.html