填空题 用以下程序把从键盘输入的字符存放到一个文件中,用字符#作为结束符,请按题意要求填空完善程序。 #include<stdio.h> main() { FILE*fp; char ch,fname[10]; printf("Input the name of file/n"); gets(fname); if(fp=fopen({{U}} 【18】 {{/U}}))==NULL) {printf("can't open/n"); {{U}} 【19】 {{/U}}; } while((ch=getchar())!='#') fputc({{U}} 【20】 {{/U}}); fclose(fp); }
  • 1、
【正确答案】 1、[18]fname,"#"    
【答案解析】[19]exit(0) [20]ch,fp