1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-13 03:11:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

存量题库数据更新

This commit is contained in:
2023-12-09 18:42:21 +08:00
parent a788808cd7
commit c198538f10
10843 changed files with 288489 additions and 248355 deletions

View File

@@ -0,0 +1,34 @@
<p>给定一个非负整数 <code>x</code> ,计算并返回 <code>x</code> 的平方根,即实现&nbsp;<code>int sqrt(int x)</code>&nbsp;函数。</p>
<p>正数的平方根有两个,只输出其中的正数平方根。</p>
<p>如果平方根不是整数,输出只保留整数的部分,小数部分将被舍去。</p>
<p>&nbsp;</p>
<p><strong>示例 1:</strong></p>
<pre>
<strong>输入:</strong> x = 4
<strong>输出:</strong> 2
</pre>
<p><strong>示例 2:</strong></p>
<pre>
<strong>输入:</strong> x = 8
<strong>输出:</strong> 2
<strong>解释:</strong> 8 的平方根是 2.82842...,由于小数部分将被舍去,所以返回 2
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><meta charset="UTF-8" /><code>0 &lt;= x &lt;= 2<sup>31</sup>&nbsp;- 1</code></li>
</ul>
<p>&nbsp;</p>
<p><meta charset="UTF-8" />注意:本题与主站 69&nbsp;题相同:&nbsp;<a href="https://leetcode-cn.com/problems/sqrtx/">https://leetcode-cn.com/problems/sqrtx/</a></p>