F0=1000
F1=F0*a-30;
F2=F1*a-30;
F3=F2*a-30;
... ....
Fn-1=Fn-2*a-30
Fn=Fn-1*a-30
Fn=0;
输入n;
输出a
F0=1000
F1=F0*a-30;
F2=F1*a-30;
F3=F2*a-30;
... ....
Fn-1=Fn-2*a-30
Fn=Fn-1*a-30
Fn=0;
输入n;
输出a
#include <stdio.h>
int n;
double a;
double fun(int tInputValue)
{
if(tInputValue == 0)
return 1000.0;
else
return fun(tInputValue-1)*a-30;
}
int main()
{
scanf("%d", &n);
for(a =0; a < 1000000; a=a+0.01)
{
if( 30-fun(n-1)*a < 1e-06 )
{
printf("%lf\n", a);
break;
}
}
}