#include"stdio.h"
#include"stdlib.h"
long a =10000, b = 0, c = 10000,d,e,f[10001],g;
int main(int argc, char const *argv[])
{
for(; b != c; f[b++] = a/5);
for(; d = 0,g = c*2,c>5000;c--,printf("%.4d",e+d/a),e = d%a)
for(b = c;d += f[b]*a,f[b]=d % --g, d /= g--, --b; d*=b );
system("pause");//这行和上面的第二个include是我自己加的。
return 0;
}
我发现我对于for语句的了解,对于c语言的了解还很困乏。这是一个算圆周率的代码,我看不懂这是咋跑起来的。有人能为我解释一下用这种方法计算圆周率的原理和三条for语句该如何理解吗?
麻烦大家了。