Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
127314 黄恩宁 计算函数值 C++ 通过 100 0 MS 264 KB 282 2024-01-25 08:38:45

Tests(5/5):


#include<iostream> #include<cstdio> #include<cmath> using namespace std; double px(int x,int n) { if(n==1) return x; if(n%2==0) return px(x,n-1)-pow(x,n); else return px(x,n-1)+pow(x,n); } int main() { int x,n; cin>>x>>n; printf("%.2f\n",px(x,n)); return 0; }


测评信息: