题目:
题解:
cpp
bool isPowerOfThree(int n){
int count=0;
while(n){
count+=n%3;
n/=3;
}return count==1?true:false;
}
题目:
题解:
bool isPowerOfThree(int n){
int count=0;
while(n){
count+=n%3;
n/=3;
}return count==1?true:false;
}