题解 | #求小球落地5次后所经历的路程和第5次反弹的高度#
求小球落地5次后所经历的路程和第5次反弹的高度
https://www.nowcoder.com/practice/2f6f9339d151410583459847ecc98446
h=int(input()) distance=h for i in range(1,6): new_h = h*((1/2)**i) if i<5: distance += 2*new_h print(distance) print(new_h)
求小球落地5次后所经历的路程和第5次反弹的高度
https://www.nowcoder.com/practice/2f6f9339d151410583459847ecc98446
h=int(input()) distance=h for i in range(1,6): new_h = h*((1/2)**i) if i<5: distance += 2*new_h print(distance) print(new_h)
相关推荐