#include<stdio.h>

main()
{
int i,n;
double s;
printf("n="); scanf("%d",&n);
i=n; s=0.0;
while (i>0){
s+=1.0/(i*i);
--i;
}
printf("n=%d,s=%f|n",n,s);
}


これです