#include
main()
{____
floata;
if((fp=fopen("datal","W"))==NULL)
{prinff("Cannotopenthefile!");exit(0);}
while(1)
{scanf("%f",&a);
____
____
}
fclose(fp);
}
【正确答案】:先判断a的值再将a写入文件。 FILE*fp; if(a==0)break: fwrite(&a,sizeof(float),l,fp);
{prinff("Cannotopenthefile!");exit(0);}
while(1)
{scanf("%f",&a);<">
{prinff("Cannotopenthefile!");exit(0);}
while(1)
{scanf("%f",&a);<">