帮忙看一下这个程序哪里表达错误了???在acm里老是过不了····
#include "stdio.h"int main()
{
int m,n,i;
float sum(int n);
scanf("%d",&m);
for(i=1;i<=m;i++)
{scanf("%d",&n);
printf("%5.2f\n",sum(n));
}
return 0;
}
float sum(int n)
{
int sign=-1;
int j;
float sum=0;
for(j=1;j<=n;j++)
{
sign=-sign;
sum=sum+(float)sign/j;
}
return sum;
}