Power of Three 带测试版
来源:互联网 发布:程序员的英语单词 编辑:程序博客网 时间:2024/05/17 21:45
public class Solution326 { public boolean isPowerOfThree(int n) { double temp = 10e-15; if(n==0) return false; double res = Math.log(n) / Math.log(3); return Math.abs(res-Math.round(res)) < temp; //或者Math.rint(); } public static void main(String[]args) { int n=243; System.out.println(isPowerOfThree(n)); }}
0 0
- Power of Three 带测试版
- 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
- Spring框架中的Cache抽象层
- java多线程简介
- java-----instanceof与getClass的区别
- 【笔记】 《js权威指南》- 第16章 脚本化CSS 16.2 重要的CSS属性
- js自定义对象和类
- Power of Three 带测试版
- MT6752/32平台 Android L版本驱动移植
- Maximum Size Subarray Sum Equals k 带测试版
- u-boot-1.1.6 移植
- java集合(二)
- Bulls and Cows 带测试版
- UIImage 切圆形图片方法
- 【Bash百宝箱】shell中如何进行数学运算
- 欢迎使用CSDN-markdown编辑器