摘要:
π的级数展开式: π/2=1+1/3+(1*2)/(3*5)+(1*2*3)/(3*5*7)+(1*2*3*4)/(3*5*7*9)+··· 代码(C语言)如下:#includedouble pi(int n){double result = 1;double temp = 1;for(int i = 1;i<=n;i++){temp=temp*i/(i*2+1);result+=temp;}return result*2;}void main(){int n;printf("input precision:");scanf(" 阅读全文