#include <stdio.h>
int main()
{ /*从键盘上输入一些字符,把这些字符送到磁盘上,直到输入#号时*/
FILE *fp;
char filename[10],ch;
scanf("%s",filename);
if((fp=fopen(filename,"w"))==NULL)
{
printf("can't open the file.\n");
exit(0);
}
ch=getchar();
ch=getchar();
while(ch!='#')
{
fputc(ch,fp);
putchar(ch);
ch=getchar();
}
fclose(fp);
return 0;
}