pts20求调
查看原帖
pts20求调
1641183
lfyu778楼主2025/2/3 00:13
#include <iostream>
#include <format>
#include <cmath>
#include <string>
using namespace std;
typedef long long ll;
int main() {
  double h;
  cin >> h;
  double sum = 0;
  for (int i = 0; i < 10; i++) {
    sum = sum + h + h / 2.0;
    h /= 2;
  }
  cout << format("{:g}\n{:g}",sum,h) << endl;
}
2025/2/3 00:13
加载中...