1.5 编程基础之循环控制 20 球弹跳高度的计算
生活随笔
收集整理的這篇文章主要介紹了
1.5 编程基础之循环控制 20 球弹跳高度的计算
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
http://noi.openjudge.cn/ch0105/20/
#include<iostream> using namespace std; int main() {double ans,h;cin>>h;ans=h;for( int i=1;i<=9;i++){h=h/2;ans+=h*2;}printf("%g\n%g\n",ans,h/2);return 0; }?
?
?
?
?
?
python3代碼
https://blog.csdn.net/weixin_45852964
""" 1.5編程基礎(chǔ)之循環(huán)控制 20 球彈跳高度的計(jì)算 http://noi.openjudge.cn/ch0105/20/https://blog.csdn.net/weixin_45852964/article/details/103586870 https://blog.csdn.net/weixin_45852964/article/details/103586089 https://blog.csdn.net/weixin_45852964/article/details/103375233 https://blog.csdn.net/weixin_45852964/article/details/103586946 https://blog.csdn.net/weixin_45852964/article/details/103481658""" h=int(input()) s=0 for i in range(10):s+=hh/=2s+=h print("%g"%(s-h)) print("%g"%h)總結(jié)
以上是生活随笔為你收集整理的1.5 编程基础之循环控制 20 球弹跳高度的计算的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 1.9编程基础之顺序查找 05 最大值和
- 下一篇: 1982:【19CSPJ普及组】数字游戏