求指导!!请问这个程序为什么运行不正确?谢谢
#include<stdio.h> main()
{
char a1[600];
int c=0;
int i,k;
float F;
FILE *fp1, *fp2;
fp1=fopen("E:\\W1.txt","r");
fp2=fopen("E:\\Q1.txt","w");
do
{
c=0;
fgets(a1,600000,fp1);
if(a1[0]!='\0')
{
for(i=0;i<=600;i++)
if(a1[i]=='\n')
break;
for(k=0;k<=i;k++)
{
if((a1[k]=='G')||(a1[k]=='C'))
c++;
}
F=100*(float)c/i;
fprintf(fp2,"%f\n",F);
}
}while(a1[0]!='@');
fclose(fp1);
fclose(fp2);
}