1166:求f(x,n)

#include<iostream>
#include<cstdio>
#include<math.h>
using namespace std;
double f(double x,int y)
{
    if(y==1)return sqrt(1+x);
    else return sqrt(y+f(x,y-1));
}
int main()
{
    double m;
    int n;
    scanf("%lf%d",&m,&n);
    printf("%.2lf",f(m,n));
    return 0;
}100'

猜你喜欢

转载自blog.csdn.net/qq_42552468/article/details/81241044