回复 18楼 wlxy_wang
我问了哈出题的人,他说不用考虑0和负数,这样就对了,他就把i定义成double型的就好了,这是为啥啊
#include<stdio.h>
int main()
{
double t=0,i;
int m;
int j;
scanf("%d",&m);
t=0;
for(j=1,i=1;i<=m;)
{
t+=j*1/(i*i*1.0);
j=-1;
i+=1;
}
printf("%.6lf\12",t);
return 0;
}
I am the voice of the next generation
Completely digital
Create synthetic auras