原题网址:http://www.lintcode.com/zh-cn/problem/sqrtx/
实现 int sqrt(int x)
函数,计算并返回 x 的平方根。
样例
sqrt(3) = 1
sqrt(4) = 2
sqrt(5) = 2
sqrt(10) = 3
挑战
O(log(x))
原题网址:http://www.lintcode.com/zh-cn/problem/sqrtx/
实现 int sqrt(int x)
函数,计算并返回 x 的平方根。
sqrt(3) = 1
sqrt(4) = 2
sqrt(5) = 2
sqrt(10) = 3
O(log(x))
转载于:https://www.cnblogs.com/Tang-tangt/p/8633953.html