二分法实现开方运算
public int sqrt(int x) { int low = 0; int high = x; while (low <= high) { long mid = (low + high) / 2;//防止溢出 if (mid * mid == x) return (int) mid; else if (mid * mid < x) low = (int) (mid + 1); else high = (int) (mid - 1); } return high; } }