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)
成绩:
20ms
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
相关文章推荐
- Node.js开发利器Webstorm的按装和免费使用
- Easy-题目68:1. Two Sum(增补1)
- ACdream 1071 神奇的%系列一
- Scala学习手记1 - 快速体验
- php - 变量
- 2016SDAU课程练习三1007
- 五种函数定义方式----第五种是重点
- ThinkPHP(6)——模板技术
- ThreadPoolExecutor机制
- 初步bash
- iOS中的窗口与视图
- CV图像转换
- Android笔记:intent
- Linux:用户与权限
- 中间件
- java多线程---等待/唤醒以及生产者消费者经典同步synchronized的实现
- Yii2-GridView常见操作
- Unity3d PackingTag 字母大小写问题,导致图集错误
- 单片机软件定时器的使用方法
- 如何通过jd-gui反编译后使用BCCompare比较源码忽略不重要差异时不显示红色