Leet Code 69. x 的平方根

class Solution {
public:
int mySqrt(int x) {
long a = x;
while (a * a > x){
a = (a + x / a) / 2;
}
return a;
}
};

class Solution {
public:
int mySqrt(int x) {
long a = x;
while (a * a > x){
a = (a + x / a) / 2;
}
return a;
}
};