题解 | #求解立方根#
求解立方根
https://www.nowcoder.com/practice/caf35ae421194a1090c22fe223357dca
src = float(input().strip()) croot = 0 eps = 1e-6 left, right = -3, 3 while abs(croot ** 3 - src) >= eps: c3 = croot ** 3 if c3 < src: left = croot croot = (right + croot) / 2 else: right = croot croot = (croot + left) / 2 print(f"{croot:.1f}")