标签:turn for print i+1 inf scan clu scanf com
#include <stdio.h>
int main()
{
double eps, sum=1, i, temp=1;
scanf("%le", &eps);
for(i=1; temp>eps; i++)
{
temp = temp*i/(2*i+1);
sum += temp;
}
printf("PI = %.5f\n", 2*sum);
return 0;
}
标签:turn for print i+1 inf scan clu scanf com
原文地址:https://blog.51cto.com/14737345/2486691