题解 | #求解立方根#
求解立方根
https://www.nowcoder.com/practice/caf35ae421194a1090c22fe223357dca
def bina(y, m, n): x = (m+n)/2 cmp = x**3 if abs(y - cmp) <= espi: ret = x elif y - cmp > espi: ret = bina(y, x, n) else: ret = bina(y, m, x) return ret n = float(input()) espi = 1e-3 right = max(n, 1) left = min(n, -1) x = bina(n, left ,right) print("{:.1f}".format(x))