Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
89496 sh25_shengmy 计算多项式的值 C++ Accepted 0 MS 260 KB 315 2026-06-05 14:30:37

Tests(1/1):


#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; }


Judgement Protocol: