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

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

http://www.nowcoder.com/practice/2f6f9339d151410583459847ecc98446

while True:
    try:
        H = int(input())
        S = 0 - H
        for i in range(5):
            S = S + H * 2
            H = H/2
        print(float(S))
        print(float(H))
    except:
        break
全部评论
这样第一个s不是-H了么
点赞 回复 分享
发布于 2022-06-17 09:52

相关推荐

allin实习的大白...:我把第二个项目发出来了,如果感兴趣可以去研究研究,欢迎交流。 https://gitee.com/jtyjtyjty333/ind-dist-ai-sec-edge-cloud https://github.com/jtylab/ind-dist-ai-sec-edge-cloud
点赞 评论 收藏
分享
评论
17
1
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务