Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
55231 | yuboyuan | 计算多项式的值 | C++ | Accepted | 1 MS | 268 KB | 215 | 2024-11-03 19:31:45 |
#include<iostream> #include<iomanip> #include<cmath> using namespace std; int main() { int n; float x; cin>>x>>n; cout<<fixed<<setprecision(2)<<((float)pow(x,n+1)-1)/(x-1); return 0; }