标签:put bsp square public turn class long imp solution
Implement int sqrt(int x)
.
Compute and return the square root of x.
1 class Solution { 2 public: 3 int mySqrt(int x) { 4 long r = x; 5 while (r*r > x) 6 r = (r + x/r) / 2; 7 return r; 8 } 9 };
标签:put bsp square public turn class long imp solution
原文地址:http://www.cnblogs.com/wujufengyun/p/7192152.html