#include<stdio.h>
2 #include<stdlib.h>
3
4 int main(int argc, const char *argv[])
5 {
6 FILE *fg=fopen("1.txt","r");
7 if(fg==NULL)
8 {
9 perror("fg");
10 return -1;
11 }
12 FILE *fg1=fopen("2.txt","w");
13 if(fg==NULL)
14 {
15 perror("fg1");
16 return -1;
17 }
18 char s[20]="";
19 while(fgets(s,sizeof(s),fg)!=NULL)
20 {
21 printf("%s\n",s);
22 fputs(s,fg1);
23
24 }
拷贝文件1.txt至2.TXT
最新推荐文章于 2023-12-10 11:00:01 发布