提交时间:2024-05-18 14:40:07

运行 ID: 147329

#include<iostream> #include<iomanip> #include<cmath> using namespace std; double f(double x,int n){ if(n == 1){ return sqrt(1+x); } return sqrt(n+f(x,n-1)); } int main(){ double x; int n; cin>>x>>n; cout<<fixed<<setprecision(2)<<f(x,n); return 0; }