编译通过,运行错误,alt+f5显示Floating point error:Divide by 0.
#include <math.h>
#include <stdio.h>
main()
{ int t=1,k=1;
float sum=1,s;
do{ t=t*k;
s=1.0/t;
sum=sum+s;
k++;
}
while(fabs(s)>=1e-5);
printf("%f\n",sum);
}
用Turbo c2.0编译通过,运行错误,alt+f5显示
Floating point error:Divide by 0.
为什么,错在哪里??