题解 | #求小球落地5次后所经历的路程和第5次反弹的高度#

求小球落地5次后所经历的路程和第5次反弹的高度

https://www.nowcoder.com/practice/2f6f9339d151410583459847ecc98446?tpId=37&tqId=21261&rp=1&ru=/exam/oj/ta&qru=/exam/oj/ta&sourceUrl=%2Fexam%2Foj%2Fta%3FtpId%3D37&difficulty=undefined&judgeStatus=undefined&tags=&title=

import sys

#for line in sys.stdin:
#    a = line.split()
#    print(int(a[0]) + int(a[1]))



h = int(input())


h5sum = 2*h *(1+1/(2**1)+1/(2**2)+1/(2**3)+1/(2**4)) -h
h5high= h*1/(2**5)
print(h5sum)
print(h5high)

全部评论

相关推荐

不会取名字的牛油:学历加大加粗,面试库库来
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务