⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pi.cpp

📁 一个可以计算4000位的Pi值的算法
💻 CPP
字号:
// Pi.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

//#include <stdlib.h>  
//#include <stdio.h>  

long a=10000,b,c=2800,d,e,f[2801],g;  

main()  
{  
for(;b-c;)  
  f[b++]=a/5;  
for(;d=0,g=c*2;c-=14,printf("%.4d",e+d/a),e=d%a)  
  for(b=c;d+=f[b]*a,f[b]=d%--g,d/=g--,--b;d*=b);  
}  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -