如题所述
#include <stdio.h>
#include <math.h>
int main()
{ int i;
double f,n,t,PI,eps=1e-16;
t=1;
PI=0;
n=1.0;
f=1;
i=1;
while (t>=eps)
{ PI+=t;
f*=2*i+1;
n*=i++;
t=n/f;
}
PI=PI*2;
printf("PI=%.14f\n",PI);
}
温馨提示:答案为网友推荐,仅供参考
第1个回答 2020-05-21
3.14159265358979(323846)前面共20位