mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-12 19:01:47 +08:00
存量题库数据更新
This commit is contained in:
@@ -1,27 +1,31 @@
|
||||
<p>给定一个 <strong>正整数</strong> <code>num</code> ,编写一个函数,如果 <code>num</code> 是一个完全平方数,则返回 <code>true</code> ,否则返回 <code>false</code> 。</p>
|
||||
<p>给你一个正整数 <code>num</code> 。如果 <code>num</code> 是一个完全平方数,则返回 <code>true</code> ,否则返回 <code>false</code> 。</p>
|
||||
|
||||
<p><strong>进阶:不要</strong> 使用任何内置的库函数,如 <code>sqrt</code> 。</p>
|
||||
<p><strong>完全平方数</strong> 是一个可以写成某个整数的平方的整数。换句话说,它可以写成某个整数和自身的乘积。</p>
|
||||
|
||||
<p> </p>
|
||||
<p>不能使用任何内置的库函数,如 <code>sqrt</code> 。</p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
<p> </p>
|
||||
|
||||
<p><strong class="example">示例 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong>num = 16
|
||||
<strong>输出:</strong>true
|
||||
<strong>解释:</strong>返回 true ,因为 4 * 4 = 16 且 4 是一个整数。
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
<p><strong class="example">示例 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong>num = 14
|
||||
<strong>输出:</strong>false
|
||||
<strong>解释:</strong>返回 false ,因为 3.742 * 3.742 = 14 但 3.742 不是一个整数。
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>1 <= num <= 2^31 - 1</code></li>
|
||||
<li><code>1 <= num <= 2<sup>31</sup> - 1</code></li>
|
||||
</ul>
|
||||
|
Reference in New Issue
Block a user