#include <math.h>
bool isPowerOfFour(int n){
int i=0;
while(pow(4,i)<n) i++;
if(pow(4,i)==n) return true;
else return false;
}
【新手上路】LeetCode刷题之“4的幂”
阅读 76
2022-03-18
#include <math.h>
bool isPowerOfFour(int n){
int i=0;
while(pow(4,i)<n) i++;
if(pow(4,i)==n) return true;
else return false;
}
相关推荐
精彩评论(0)