求f(x,n)

#include<iostream>
#include<cmath>
#include <bits/stdc++.h>
using namespace std;
double a(double n,double x){
    if(n==0){
        return x;
    }else{
        return sqrt(n+a(n-1,x));
    } 
}
int main(){
    double x,n,y;
    cin>>x>>n;
    y=a(n,x);
    cout<<fixed<<setprecision(2)<<y;
    return 0;
}

 

posted @ 2023-08-01 19:15  爱吃泡面的皮卡  阅读(69)  评论(0)    收藏  举报