로딩
요청 처리 중입니다...

[c언어][파일 입출력][학생성적을 평균으로 바꾸기]

 [c언어][파일 입출력][학생성적을 평균으로 바꾸기]

#include struct stu { char name[30]; int kor, math, eng; float avg; }; int main() { struct stu s; char buffer[256]; float result; FILE *fp1; FILE *fp2; if ((fp1 = fopen("student.txt", "r")) == NULL) { fprintf(stderr, "Can not find file"); } if ((fp2 = fopen("student_avg.txt", "w")) == NULL) { fprintf(stderr, "Can not find file"); } printf("이름 국어 수학 영어"); while (!feof(fp1)) { fscanf(fp1, "%s %d %d %d", s.name, &s.kor, &s.math, &s.eng); result = s.kor + s.math + s.eng; s.avg = result/3; ...