求改错指正
从键盘上输入若干个学生成绩,以-99作为结束标志,然后写入到当前目录下的文件XSXX. txt中,数据中间用空格分隔。#include <stdio.h>
#include <stdlib.h>
int main()
{ EILE *fp;
int grade ;
if( (fp=fopen ("xs. txt", "a+"))==NULL)
{printf ("文件打开失败! \n") ;
exit(0); }
scanf ("%d", &grade) ;
while (grade<>-99)
{printf (fp,"%d",grade) ;
scanf("%d",&grade);}
fclose(fp) ;
return 0;
}