<?xml version="1.0" encoding="utf-8"?>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
<meta content="width=device-width, initial-scale=1" name="viewport"/>
263. 丑数
<meta content="Org mode" name="generator"/>
<meta content="吴丹阳 https://www.cnblogs.com/wudanyang" name="author"/>
<meta content="leetcode" name="keywords"/>
<style type="text/css">
</style>
<body>
263. 丑数
Table of Contents
1 题目
263. 丑数
2 代码
class Solution {
/**
* @param Integer $num
* @return Boolean
*/
function isUgly($num) {
if ($num < 1) {
return false;
}
while ($num % 2 == 0) {
$num = floor($num / 2);
}
while ($num % 3 == 0) {
$num = floor($num / 3);
}
while ($num % 5 == 0) {
$num = floor($num / 5);
}
return $num == 1;
}
}
3 思路
===
作者: 吴丹阳 https://www.cnblogs.com/wudanyang
更新时间: 2020-09-01 Tue 21:24
Emacs 27.1 (Org mode 9.3.7)
===
天行健,君子以自强不息。
地势坤,君子以厚德载物。
===