Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
127436 马佳琪 计算函数值 C++ 编译错误 0 0 MS 0 KB 284 2024-01-25 09:05:48

Tests(0/0):


#include <bits/stdc++.h> using namespace std; int main() { int n,m; cin>>n>>m; unsigned long long sum=0; for(int i=1;i<=m;i++){ if(i%2!=0) sum+=pow(n,i); else sum-=pow(n,i); } cout<<fixed<<setpresicion(2)<<sum<<endl; return 0; }


测评信息: