Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
47156 | lmz120809 | 【例39.2】 球弹跳高度的计算 | C++ | No Test Data | 0 MS | 0 KB | 196 | 2024-05-12 17:10:43 |
#include<iostream> using namespace std; int main() { double h,b=0,sum=0; cin>>h; for(int i=1;i<=10;i++){ sum=sum+h+b; h=h/2; b=h; } cout<<sum<<endl; cout<<h; return 0; }