![](https://lstatic.shangxueba.com/sxbzda/h5/images/m_q_title.png)
从键盘输入一串字符(""作为结束标志),将其写入文本文件file.dat中保存。 include<stdio.h> includ
从键盘输入一串字符(""作为结束标志),将其写入文本文件file.dat中保存。
include<stdio.h>
include<stdlih.h>
main()
{char ch;
FILE*fp:
if((fp=fopen("file.det","______"))==NULL)/*第一空*/
{printf("Can not open file\n");exit(0);}
ch=getchar();
whil(ch!'')
{fputc(______,fp);/*第二空*/
ch=getchar();
}
fclose(______); /*第三空*/
}
![](https://lstatic.shangxueba.com/sxbzda/h5/images/tips_org.png)