Files
OI-source/history_source/信息学奥赛一本通/1.6.2.4.cpp
2023-08-03 09:22:52 +08:00

15 lines
205 B
C++

#include<cstdio>
#include<cmath>
using namespace std;
double f(double x,int n)
{
if(n==1) return sqrt(1+x);
return sqrt(n+f(n-1,x));
}
int main()
{
printf("%g\n%g\n",f(4.2,10),f(2.5,15));
return 0;
}