1 static int wing=[]()
 2 {
 3     std::ios::sync_with_stdio(false);
 4     cin.tie(NULL);
 5     return 0;
 6 }();
 7 
 8 
 9 class Solution 
10 {
11 
12 public:
13     bool isPowerOfFour(int num) 
14     {
15         return ((num-1)&num)==0 && (num-1)%3==0;
16     }
17 
18 };

像这种本身就是某数的幂的,除了int最大幂求余为0外,还有加个判定,就是(num-1)%(n-1)==0

posted on 2018-05-25 18:00  高数考了59  阅读(85)  评论(0)    收藏  举报