1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-05 15:31:43 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
Files
leetcode-problemset/leetcode-cn/problem (Chinese)/丑数 [ugly-number].html
2025-01-09 20:29:41 +08:00

36 lines
1.0 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p><strong>丑数 </strong>就是只包含质因数&nbsp;<code>2</code><code>3</code><code>5</code>&nbsp;&nbsp;<em>&nbsp;</em>整数。</p>
<p>给你一个整数 <code>n</code> ,请你判断 <code>n</code> 是否为 <strong>丑数</strong> 。如果是,返回 <code>true</code> ;否则,返回 <code>false</code></p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>n = 6
<strong>输出:</strong>true
<strong>解释:</strong>6 = 2 × 3</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>n = 1
<strong>输出:</strong>true
<strong>解释:</strong>1 没有质因数。</pre>
<p><strong>示例 3</strong></p>
<pre>
<strong>输入:</strong>n = 14
<strong>输出:</strong>false
<strong>解释:</strong>14 不是丑数,因为它包含了另外一个质因数&nbsp;<code>7 </code>
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>-2<sup>31</sup> &lt;= n &lt;= 2<sup>31</sup> - 1</code></li>
</ul>