Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
127516 陈道宁 计算函数值 C++ 通过 100 0 MS 256 KB 222 2024-01-25 09:22:17

Tests(5/5):


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


测评信息: