Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
86863 sh25_zhoumy 计算多项式的值 C++ 通过 0 MS 260 KB 315 2026-04-10 14:30:18

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


测评信息: