import sys for input in sys.stdin: input=float(input) sign=(input>0)#似乎不需要处理负数就能通过测试 if not sign: input=-input test=input/2 up=input down=0 #for i in range(10): while True : if up-down<0.01: print(round(test,1)) break if test*test*test <input: #print(test) down=test test=((test+up)/2) elif test*test*test >input: #print(test) up=test test=((test+down)/2)