标签:rgb printf alt namespace iostream size oid space str
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int b;
double a,s;
void fun(double x,int d)//引入递归深度
{
if(d==b) return;
s=s+x;
fun(sqrt(x),d+1);
}
int main()
{
while(scanf("%lf%d",&a,&b)!=EOF)
{
fun(a,0); //注意这里填0
printf("%.2lf\n",s);
s=0;
}
return 0;
}
标签:rgb printf alt namespace iostream size oid space str
原文地址:https://www.cnblogs.com/Hello-world-hello-lazy/p/14220281.html