题解 | #求小球落地5次后所经历的路程和第5次反弹的高度#
求小球落地5次后所经历的路程和第5次反弹的高度
http://www.nowcoder.com/practice/2f6f9339d151410583459847ecc98446
#####采用37题递归的思想# while 1: try: H=int(input()) n=5 n_t=(1/(2**n))H def L(m): if m==1: return H else: return L(m-1)+(1/(2*(m-1)))H2 print(L(5)) print(round(n_t,6)) except: break