我的那错了,希望有心人帮忙,谢谢了
#include <stdio.h>
float qiuhe(int n)
{
float sum,s;
int i;
sum=1;
for (i=2;i<=n;i++)
{
s=1/(i*i);
sum-=s;
}
return sum;
}
main()
{
int n;
float sum;
printf("input n:\n");
scanf("%d",&n);
sum=qiuhe(n);
printf("%f",sum);
}