c语言 π/2=1+1/3*2/5+1/3*2/5*3/7+1/3*2/5*3/7*4/9+...求π精确到0.0001double n,t,sum,pi;sum=1.0;n=1.0t=1.0;do{t=t*(n/(2*n+1));sum=sum+t;}while(n/(2*n+1)

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/16 09:23:14

c语言 π/2=1+1/3*2/5+1/3*2/5*3/7+1/3*2/5*3/7*4/9+...求π精确到0.0001double n,t,sum,pi;sum=1.0;n=1.0t=1.0;do{t=t*(n/(2*n+1));sum=sum+t;}while(n/(2*n+1)
c语言 π/2=1+1/3*2/5+1/3*2/5*3/7+1/3*2/5*3/7*4/9+...求π精确到0.0001
double n,t,sum,pi;
sum=1.0;
n=1.0
t=1.0;
do{
t=t*(n/(2*n+1));
sum=sum+t;
}
while(n/(2*n+1)

c语言 π/2=1+1/3*2/5+1/3*2/5*3/7+1/3*2/5*3/7*4/9+...求π精确到0.0001double n,t,sum,pi;sum=1.0;n=1.0t=1.0;do{t=t*(n/(2*n+1));sum=sum+t;}while(n/(2*n+1)
题目是 x/2 = .
do while 里面只是计算的等式的右端,所以乘以2才是x