博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
100M小球
阅读量:4230 次
发布时间:2019-05-26

本文共 370 字,大约阅读时间需要 1 分钟。

百米小球回弹

# (选做)一个小球从100m高度落下,每次弹回原高度一半.#    计算:#     -- 总共弹起多少次?(最小弹起高度0.01m)#     -- 全过程总共移动多少米?#    提示:#        数据/算法   print("总共弹起%s次,全过程总共移动%s米"%(str(count),))count = 0sum = 100distance = height = 100while height / 2 > 0.01:    height /= 2    count += 1    distance += height * 2    print(height)    print(count)    print("总共弹起%s次,全过程总共移动%f米" % (str(count), distance))

转载地址:http://cynqi.baihongyu.com/

你可能感兴趣的文章
Pattern-Oriented Software Architecture, Volume 1: A System of Patterns
查看>>
Database Programming with Visual Basic® .NET and ADO.NET: Tips, Tutorials, and Code
查看>>
Visual Basic 2005 Express: Now Playing
查看>>
Jakarta Struts Cookbook
查看>>
AspectJ Cookbook
查看>>
IntelliJ IDEA in Action
查看>>
HTML Professional Projects
查看>>
Python Cookbook, Second Edition
查看>>
Java Extreme Programming Cookbook
查看>>
XSLT Cookbook
查看>>
Java Programming with Oracle JDBC
查看>>
Hack Proofing Your Network (Second Edition)
查看>>
XML Programming (Core Reference)
查看>>
Visual Studio .NET: The .NET Framework Black Book
查看>>
Best Kept Secrets in .NET
查看>>
SQL: The Complete Reference
查看>>
Wireless Network Hacks & Mods For Dummies
查看>>
Programming INDIGO
查看>>
.NET Development Security Solutions
查看>>
3ds Max 8 Bible
查看>>