求1/1!+1/2!+1/3!+。。。+1/n!
#include <stdio.h>int main (void)
{
int n,i,a,b,c=1;
float sum=0;
fprintf(stdout,"请输入值\n");
fscanf(stdin,"%d",&n);
for(i=1;i<=n;i++)
{
a=1/i;
b=c*a;
c=b;
sum=sum+(float)b;
}
fprintf(stdout,"%f",sum);
return 0;
}哪里错了