提交时间:2024-05-12 14:27:15
运行 ID: 47096
#include<iostream> using namespace std; int main() { double h0, i, s, h; while (cin >> h0) { s = 0; h = 0; for (i = 1; i <= 11; i=i++) s += h0 + h; h = h0 * 0.5; h0 = h; } cout << s << ' ' << h<<endl; } return 0; }