| Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 77652 | sh25_wuyy | 计算多项式的值 | C++ | 通过 | 0 MS | 260 KB | 310 | 2025-12-26 14:35:59 |
#include<iostream> #include<cstdio> #include<cstring> #include<cmath> using namespace std; int main() { float x; int n; float tot=0; cin>>x>>n; int a=n; for(int i=n;i>=1;i--) { tot=tot+pow(x,a); a--; } printf("%.2f",tot+1); return 0; }