1.一个小球从1000m的高度落下,每次回弹原高度的一半。
请计算:
每次回弹高度
总共弹起多少次,最终落地(最小弹起高度0.1m)
总共经过多少米。
height = 1000
times = 0
lenth = 1000
while height/2 >= 0.01:
height /=2
times +=1
lenth += height
print
1.一个小球从1000m的高度落下,每次回弹原高度的一半。
请计算:
每次回弹高度
总共弹起多少次,最终落地(最小弹起高度0.1m)
总共经过多少米。
height = 1000
times = 0
lenth = 1000
while height/2 >= 0.01:
height /=2
times +=1
lenth += height
print