class Solution {
public boolean isPowerOfThree(int n) {
if(n<1) return false;
while(n%3==0){
n/=3;
}
return n==1;
}
}
leetcode No.326 3的幂(代码简洁,学习)
猜你喜欢
转载自blog.csdn.net/qq_33399567/article/details/89303147
今日推荐
周排行