Power of Three
来源:互联网 发布:网络寄生虫 编辑:程序博客网 时间:2024/05/16 20:30
Given an integer, write a function to determine if it is a power of three. Could you do it without using any loop / recursion?
bool isPowerOfThree(int n) {
if(n==0)
{
return false;
}
double x=log10(n)/log10(3);
return floor(x)==x;
}
0 0
- leetcode Power of Three
- Leetcode: Power of Three
- LeetCode Power of Three
- 326. Power of Three
- Leetcode230: Power of Three
- Power of Three
- [leetcode]Power of Three
- LeetCode-Power of Three
- leetcode power of three
- 64. Power of Three
- LeetCode----Power of Three
- 326. Power of Three
- Power of Three
- LEETCODE--Power of Three
- 326. Power of Three
- 【leetcode】Power of Three
- 326. Power of Three
- 326. Power of Three
- as 安装插件版svn
- 在安卓开发中需要运用手机振动的功能
- 一个成功人士应该具备的能力
- linux i2c子系统代码分析4 ---操作函数i2c_add_driver i2c_register_driver介绍
- SQl语句中使用占位符的优点
- Power of Three
- solr 查询某字段为空字符串和该字段不存在的查法
- 队列
- Metoer学习过程
- 深度学习网络结构
- ionic 检测版本更新,Android版,IOS在浏览器打开下载页面。
- Python日志输出——logging模块
- 一行代码,解决百度云大文件下载限制
- Android基础---->XMl数据的解析