#include <stdio.h>
#include<stdlib.h>
int main()
{
FILE* fp;
int a;
int M, E, C;
float AVG;
a = 1001;
M = 90;
E = 80;
C = 70;
fp = fopen("score.txt", "r");
FILE* fp2;
AVG = (C + M + E) / 3;
fp2 = fopen("score_avg.txt", "w+");
fprintf(fp2, "学号:%d高数成绩:%d 英语成绩:%d C语言成绩:%d 平均分:%d\n",a,M,E,C);
return 0;
}
运行出来就是平均分不对,其他没什么问题,不知道代码有没有什么错误,ball ball大佬们!!!感谢