#include<stdio.h>
int jc(int x);
double power(double x,int t);
void main()
{
int n = 0;
double a = 0.0;
double s = 0.0;
double m = 0.0;
double x = 0.0;
double z = 0.0;
scanf("%d",&x);
for(n = 1;n <= 20;n++)
{
z = power(x,2*n-1);
m = (2*n-1)*jc(n-1);
s = power(-1,n-1);
a = s*(z/m);
printf("%lf\n",a);
}
}
int jc(int x)
{
int i = 0;
int p = 0;
for(i = 1;i <= x;i++)
p *= i;
return p;
}
double power(double x,int t)
{
int i = 0;
int q = 0;
for(i = 1;i <= t;i++)
q *= i;
return q;
}
---------------
干嘛要强制转换啊
本来就是double类型的啊