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