first commit

master^2
Ozhao 4 years ago
parent bc76a7b7c2
commit 2f0e8722c2

@ -0,0 +1,22 @@
int main()
{
double x,k=1,f=1,e,n;
double a=0;
scanf("%lf %lf",&x,&n);
if(n < 0)
printf("error");
else
{
for(int i = 1;i <= n;i++)
{
a =pow((double)x,(double)i);
k = k*i;
e = a/k;
f += e;
}
printf("%.6lf",f);
}
return 0;
}
Loading…
Cancel
Save