main()
{
float s=0;
int t=1;
for (int i = 1; 1.0 / i > 10e-6; i=i+2)
{
s+= 1.0 / (i * t);
t = -t;
}
printf("圆周率为:%f", s * 4);
}
10-17
6527
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
main()
{
float s=0;
int t=1;
for (int i = 1; 1.0 / i > 10e-6; i=i+2)
{
s+= 1.0 / (i * t);
t = -t;
}
printf("圆周率为:%f", s * 4);
}