色婷婷狠狠18禁久久YY,CHINESE性内射高清国产,国产女人18毛片水真多1,国产AV在线观看

Python計算一球從100米高度自由落下,每次落地后反跳回原高度的一半;再落下,求它在,第1?

林雅南2年前12瀏覽0評論

high=100n=10high_all=0#第n次落地時走過的長度high_each=0#每次落地的高度defball_lands(n):globalhigh_all,high_each,high#小球第一次落地時ifn==0:high_each=highhigh_all+=high_each#print('1',high_each,high_all)returnhigh_each#從小球第n次落地往前推high_each=high*(1/2)**nprint(u'第%d次小球彈起的高度為:%.2f'%(n,high_each))high_all+=high_each*2#print('2',high_each,high_all)ball_lands(n-1)ball_lands(n)print(u'小球落地%d次,共經(jīng)過%.2f米。'%(n,high_all))