标签:
#include<stdio.h>
#include<math.h>
int main()
{
int i=3;
double sum=1.0;
int sign=-1;
while(fabs(1.0/i)>1e-6)
{
sum+=(1.0/i)*sign;
sign=sign*(-1);
i=i+2;
}
printf(" ∏的近似值为%lf",4.0*sum);
return 0;
}
标签:
原文地址:http://www.cnblogs.com/ncuhwxiong/p/5244381.html