C语言,为什么得到的结果只有15个,我设置了16个数的啊,最后一个循环
/* Note:Your choice is C IDE */
#include "stdio.h"
#include "math.h"
int QD(float q)
{FILE *fp;
int d,D;
float Q;
fp=fopen("d:\\DQ.txt","r");
while(!feof(fp))
{fscanf(fp,"%d %f",&D,&Q);
if(abs(q)<Q)
{d=D;break;}
}
return(d);
}
main()
{FILE *fp;
int i=0,n=1,flag=1,d[16],j;
float l[16],q[16];
fp=fopen("d:\\LQ.txt","r");
while(!feof(fp))
{fscanf(fp,"%f %f",&l[i],&q[i]);
i++;
}
fclose(fp);
for(i=0;i<16;i++)
printf(" %d ",QD(q[i]));
}
各位大哥,帮帮我,为什么出来的结果是15个,我想要的是16个啊,郁闷啊,帮帮我吧