bool isPowerOfThree(int n){
if(n<=0){
return false;
}
long int sum=1;
for(int a=0;a<1000;a++){
if(sum==n){
return true;
}
if(sum>n){
break;
}
sum=sum*3;
}
return false;
}
09-16
614
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-29
490
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
07-23