3.1415926535 8979323846 2643383279 5028841971 6939937510 5820974944 5923078164 0628620899 8628034825 3421170679 8214808651 3282306647 0938446095 5058223172 5359408128 4811174502 8410270193 8521105559 6446229489 5493038196 4428810975 6659334461 2847564823 3786783165 2712019091 4564856692 3460348610 4543266482 1339360726 0249141273 7245870066 0631558817 4881520920 9628292540 9171536436 7892590360 0113305305 4882046652 1384146951 9415116094 3305727036 5759591953 0921861173 8193261179 3105118548 0744623799 6274956735 1885752724 8912279381 8301194912 9833673362 4406566430 8602139494 6395224737 1907021798 6094370277 0539217176 2931767523 8467481846 7669405132 0005681271 4526356082 7785771342 7577896091 7363717872 1468440901 2249534301 4654958537 1050792279 6892589235 4201995611 2129021960 8640344181 5981362977 4771309960 5187072113 4999999837 2978049951 0597317328 1609631859 5024459455 3469083026 4252230825 3344685035 2619311881 7101000313 7838752886 5875332083 8142061717 7669147303 5982534904 2875546873 1159562863 8823537875 9375195778 1857780532 1712268066 1300192787 6611195909 2164201989
[编辑本段]【C++编译器中的运算程序】
微机WindowsXP中Dev-cpp中的运算程序(30000位)(C++)
#include
#include
#include
#define N 30015
using namespace std;
void mult (int *a,int b,int *s)
{
for (int i=N,c=0;i>=0;i--)
{
int y=(*(a+i))*b+c;
c=y/10;
*(s+i)=y%10;
}
}
void divi (int *a,int b,int *s)
{
for (int i=0,c=0;i<=N;i++)
{
int y=(*(a+i))+c*10;
c=y%b;
*(s+i)=y/b;
}
}
void incr(int *a,int *b,int *s)
{
for (int i=N,c=0;i>=0;i--)
{
int y=(*(a+i))+(*(b+i))+c;
c=y/10;
*(s+i)=y%10;
}
}
bool eqs(int *a,int *b)
{
int i=0;
while (((*(a+i))==(*(b+i)))&&(i<=N)) i++;
return i>N;
}
int main(int argc, char *argv[])
{
int lpi[N+1],lls[N+1],lsl[N+1],lp[N+1];
int *pi=lpi,*ls=lls,*sl=lsl,*p=lp;
for (int i=0;i<=N;i++)*(pi+i)=*(ls+i)=*(sl+i)=*(p+i)=0;
memset(pi,0,sizeof(pi));
memset(ls,0,sizeof(ls));
memset(sl,0,sizeof(sl));
memset(p,0,sizeof(p));
*pi=*ls=*sl=1;
for (int i=1;true;i++)
{
mult(ls,i,sl);
divi(sl,2*i+1,ls);
incr(pi,ls,p);
if (eqs(pi,p)) break;
int *t;
t=p;
p=pi;
pi=t;
if (i%50==0) cout << i << " ";
}
cout << endl;
mult(p,2,pi);
ofstream fout("pi.txt");
fout << *pi << ".";
for (int i=1;i<=N;i++)
{
fout << *(pi+i);
if (i%10==0) fout << " ";
if (i%80==0) fout << endl;
}
return EXIT_SUCCESS;
}
注:①运行时会有数据弹出,这无关紧要,只为了加快了感觉速度;
②最后的txt文本里有30015位,最后15位可能是错的。
③程序中的<,>是大写的请改成小写。
注:程序中有语法错误。请高人改正。
[编辑本段]【背圆周率的口诀】
3 . 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6
山巅一寺一壶酒,尔乐苦煞吾,把酒吃,酒杀尔,杀不死,乐尔乐。
4 3 3 8 3 2 7 9 5 0 2 8 8 4 1 9 7 1 6 9 3 9 9 3 7
死珊珊,霸占二妻。救我灵儿吧!不只要救妻,一路救三舅,救三妻。
5 1 0 5 8 2 0 9 7 4 9 4 4 5 9 2 3 0 7
我一拎我爸,二拎舅(其实就是撕我舅耳)三拎妻。
8 1 6 4 0 6 2 8 6 2 0 8 9 9 8 6
不要溜!司令溜,儿不溜!儿拎爸,久久不溜!
2 8 0 3 4 8 2 5 3 4 2 1 1 7 0 6 7 9 8
饿不拎,闪死爸,而我真是饿矣!要吃人肉?吃酒吧!
(作者华罗庚)
来历:有个教书先生,喜欢喝酒,每次总是给学生留道题,就到私塾的后山上找山上的老和尚喝酒。这天,他给学生留了道题,就是背这个圆周率,然后自己提壶酒就到山上的庙里去了。圆周率位数这么多,不好背啊,其中有个聪明的学生就想出了一个办法,把圆周率编了个打油诗:山巅一寺一壶酒,尔乐苦煞吾,把酒吃;酒杀尔杀不死,乐尔乐。其实就是3.1415926535897932384626的谐音。先生一回来,学生居然都把这个给背了下来,很是奇怪,一想,就什么都明白了,原来是在讽刺他呀……
中国人用的是谐音记忆法,外国人一般用字长记忆法。例:
3. 1 4 1 5 9
Now I, even I, would celebrate
2 6 5 3 5
In rhymes inapt, the great
8 9 7 9
Immortal Syracusan, rivaled nevermore,
3 2 3 8 4
Who in his wondrous lore,
6 2 6
Passed on before,
4 3 3 8
Left men his guidance
3 2 7 9
How to circles mensurate.
字太多,我删了,具体的就看这个
圆周率的最新计算纪录由日本人金田康正的队伍所创造。他们于2002年算出π值1,241,100,000,000 位小数,这一结果打破了他们于1999年9月18日创造的206,000,000,000位小数的世界纪录。
圆周率500位
3.14159 26535 89793 23846 26433
83279 50288 41971 69399 37510
58209 74944 59230 78164 06286
20899 86280 34825 34211 70679
82148 08651 32823 06647 09384
46095 50582 23172 53594 08128
48111 74502 84102 70193 85211
05559 64462 29489 54930 38196
44288 10975 66593 34461 28475
64823 37867 83165 27120 19091
45648 56692 34603 48610 45432
66482 13393 60726 02491 41273
72458 70066 06315 58817 48815
20920 96282 92540 91715 36436
78925 90360 01133 05305 48820
46652 13841 46951 94151 16094
33057 27036 57595 91953 09218
61173 81932 61179 31051 18548
07446 23799 62749 56735 18857
52724 89122 79381 83011 94912
三千有没有?