提交时间:2025-10-24 14:56:36
运行 ID: 71117
#include <iostream> #include <cmath> using namespace std; int main() { int h; cin >> h; double total_distance = h; // 第一次落地经过的距离 double current_height = h; // 计算第2到第10次落地 for (int i = 2; i <= 10; i++) { current_height /= 2; // 反弹高度 total_distance += 2 * current_height; // 下落和反弹 } // 第10次反弹高度 double tenth_bounce = current_height / 2; cout << total_distance << endl; cout << tenth_bounce << endl; return 0; }