题解 | #求小球落地5次后所经历的路程和第5次反弹的高度#
求小球落地5次后所经历的路程和第5次反弹的高度
https://www.nowcoder.com/practice/2f6f9339d151410583459847ecc98446
#include <bits/stdc++.h>
using namespace std;
int main() {
float h;
cin >> h;
float s =-h;
for(int i=0; i <5; i++){
s +=2*h;
h =h/2;
}
cout << s << endl;
cout << h <<endl;
}

