for 循环哪错了啊,为什么运行不起来
#include<stdio.h>#include<math.h>
void main()
{
int n=2;
float i,t,sum;
for(i=1;fabs(t)>1e-6;i++)
{
t=pow(-1,n)*(1/(2*i-1));
sum+=t;
n++;
}
printf("pi的值为:%.2f\n%d",sum,n);
}
2014-12-04 16:58

2014-12-04 17:12
2014-12-04 22:00
2014-12-05 12:15
2014-12-05 13:24