1个回答
展开全部
#include <stdio.h>
main()
{
FILE* out=fopen("test1.txt","w");
FILE* in;
char c;
printf("Please input your char:\n");
while(scanf("%c",&c)==1)
{
if(c=='#') break;
fprintf(out,"%c",c);
}
fclose(out);
in=fopen("test1.txt","r");
while(fscanf(in,"%c",&c)==1)
{
printf("%c",c);
}
fclose(in);
}
main()
{
FILE* out=fopen("test1.txt","w");
FILE* in;
char c;
printf("Please input your char:\n");
while(scanf("%c",&c)==1)
{
if(c=='#') break;
fprintf(out,"%c",c);
}
fclose(out);
in=fopen("test1.txt","r");
while(fscanf(in,"%c",&c)==1)
{
printf("%c",c);
}
fclose(in);
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询