提交时间:2026-04-10 14:30:18

运行 ID: 86863

#include <bits/stdc++.h> using namespace std; int main() { float x; int n; cin >> x >> n; float sum; if (x == 1) { sum = n + 1; } else { sum = (pow(x, n+1) - 1) / (x - 1); } cout << fixed << setprecision(2) << sum << endl; return 0; }