69,373
社区成员
发帖
与我相关
我的任务
分享
#include "stdlib.h"
int main() {
FILE* in_file = fopen("in.txt", "r");
FILE* out_file = fopen("out.txt", "w");
if (!in_file) {
fclose(out_file);
return 1;
}
while (!feof(in_file)) {
char buffer[128];
fgets(buffer, sizeof(buffer), in_file);
fputs(buffer, out_file);
}
fclose(out_file);
fclose(in_file);
return 0;
}