您的位置:首页 > 其它

Easy-题目69:342. Power of Four(增补2)

2016-05-30 22:48 316 查看
题目原文:

Given an integer, write a function to determine if it is a power of four.

题目大意:

给出一个整数,判断是不是4的幂。

题目分析:

懒得写了,穷举。

源码:(language:cpp)

class Solution {
public:
bool isPowerOfFour(int n) {
return (n==1||n==4||n==16||n==64||n==256||n==1024||n==4096||n==16384||n==65536||n==262144||n==1048576||n==4194304||n==16777216||n==67108864||n==268435456||n==1073741824);
}
};


成绩:

20ms
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: