2013年7月26日

摘要: π的级数展开式: π/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(" 阅读全文
posted @ 2013-07-26 17:37 buptpatriot 阅读(1527) 评论(0) 推荐(0) 编辑

导航