Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
129029 赖泓君 计算函数值 C++ 通过 100 0 MS 264 KB 207 2024-01-26 15:43:27

Tests(5/5):


#include<bits/stdc++.h> using namespace std; int main(){ int x,n; cin>>x>>n; double tmp=0; for(int i=1;i<=n;i++){ if(i%2==1) tmp+=pow(x,i); else tmp-=pow(x,i); } printf("%.2f",tmp); }


测评信息: