- 注册时间
- 2005-1-3
- 最后登录
- 1970-1-1
|
发表于 2005-12-19 20:29:00
|
显示全部楼层
- #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);
- }
- 计算结果:
- 314159265358979323846264338327950288419
- 716939937510582097494459230781640628620
- 899862803482534211706798214808651328230
- 664709384460955058223172535940812848111
- 745028410270193852110555964462294895493
- 038196442881097566593344612847564823378
- 678316527120190914564856692346034861045
- 432664821339360726024914127372458700660
- 631558817488152092096282925409171536436
- 789259036001133053054882046652138414695
- 194151160943305727036575959195309218611
- 738193261179310511854807446237996274956
- 735188575272489122793818301194912983367
- 336244065664308602139494639522473719070
- 217986094370277053921717629317675238467
- 481846766940513200056812714526356082778
- 577134275778960917363717872146844090122
- 495343014654958537105079227968925892354
- 201995611212902196086403441815981362977
- 477130996051870721134999999837297804995
- 10597317328160963185
复制代码
注:由于UBB转码"加粗"。
请把最后一句的两个{b}改成"数组"方括号。
|
|