Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
7860 | 黄宜洋 | 求解函数 | C++ | Accepted | 0 MS | 280 KB | 425 | 2025-05-24 14:18:10 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; double f(double x, int n){ if(n==1) return x+1; return x/(n+f(x,n-1)); } int main(){ double x; int n; cin>>x>>n; printf("%.2lf",f(x,n)); return 0; }