题解 | 求小球落地5次后所经历的路程和第5次反弹的高度
求小球落地5次后所经历的路程和第5次反弹的高度
https://www.nowcoder.com/practice/2f6f9339d151410583459847ecc98446
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
int h;
cin >> h;
cout << setprecision(6) << 2.875 * h << endl;
cout << setprecision(6) << float(h) / 32 << endl;
return 0;
}
// 64 位输出请用 printf("%lld") 1.5 0.75 0.375 0.1875 0.09375
查看7道真题和解析