发布网友 发布时间:2022-04-24 12:36
共1个回答
热心网友 时间:2023-10-13 01:14
#define Size
#include<stdio.h>
int main()
{
char buf[Size],fn1[]="poem1.txt",fn2[]="poem2.txt";
FILE *f1=NULL,*f2=NULL;
f1=fopen(fn1,"r");
f2=fopen(fn2,"w+");
while(fgets(buf,Size,f1))
{
fputs(buf,f2);
}
fseek(f2,0,SEEK_SET);
while(fgets(buf,Size,f2))
{
printf("%s",buf);
}
fclose(f1);
fclose(f2);
return 0;
}