多情鞋垫

文章
4
资源
0
加入时间
3年0月27天

Sqrt(x)

题目描述Implement int sqrt(int x).Compute and return the square root of x.x is guaranteed to be a non-negative integer.解题思路有一个避免溢出的方法 避免溢出的小技巧,就是把mid*mid == x写成mid == x/mid。对于一个非负整数,它的平方根不会超