pythonExample100/JCP020.py

17 lines
328 B
Python
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

'''
【程序20】
题目一球从100米高度自由落下每次落地后反跳回原高度的一半再落下求它在
   第10次落地时共经过多少米第10次反弹多高
1.程序分析:见下面注释
2.程序源代码:
'''
Sn = 100.0
Hn = Sn / 2
for n in range(2,11):
Sn += 2 * Hn
Hn /= 2
print 'Total of road is %f' % Sn
print 'The tenth is %f meter' % Hn