编程计算1-1/3!+1/5!+.+(-1)^n-1/(2n-1)!,
#include
void main()
{double s,t,n;
int x;
printf("please input n:");
scanf(%lf",&n);
t=1;x=1;s=1;
do{ x=x+2;
t=-t*/(n-10)/n;
s=s+t;
}while (x
人气:160 ℃ 时间:2020-09-30 07:54:16
解答
#include
void main()
{
double s,t;
int n,x;
coutn;
n=1;s=0;t=1;
do
{
t=-t/(2*x-1)/(2*x-2);
s=s+t;
x=x+2;
}while (x
推荐
猜你喜欢