#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main() {
	char str[100][100] = { NULL, };
	FILE* pf1, * pf2;
	pf1 = fopen("input.txt", "r");
	
	if (pf1 == NULL) perror("파일 열기 실패\n");
	else {
		printf("파일 열기 성공\n");
		int i = 0;
		while (feof(pf1) == 0) {
			fgets(str[i], sizeof(str)/sizeof(str[0]), pf1);
			i++;
		}			
	}
	fclose(pf1);
	pf2 = fopen("output.txt", "w");
	if (pf2 == NULL) perror("파일 열기 실패\n");
	else {
		printf("파일 열기 성공\n");
		int i = 0;
		while (str[i][0] != NULL) {
			fputs(str[i], pf2);
			i++;
		}
	}
	fclose(pf2);
	return 0;
}