【LeetCode】 69. Sqrt(x)

题目:求平方根。。。必须返回的是整数,就是小数点要舍弃。


思路:直接用轮子。。。sqrt()


代码:

class Solution {

    public int mySqrt(int x) {
        return (int)Math.sqrt(x);
    }
}

相关文章:

  • 2021-11-09
  • 2021-06-14
  • 2022-01-22
  • 2021-07-07
  • 2022-12-23
  • 2021-11-29
猜你喜欢
  • 2021-11-23
  • 2021-07-31
  • 2021-12-08
  • 2021-08-08
相关资源
相似解决方案