user-0 提问: 求大佬帮写个c语言程序

回复:
user: user-1
content: #include <stdio.h>  int main() {     int stu[109][4]={0};     FILE *fp1, *fp2;     fp1 = fopen("test4","r+");     if (fp1==NULL)     {         printf("test4 cannot open\n");         return -1;     }     fp2 = fopen("test5","r+");     if(fp2==NULL){         printf("test5 cannot open\n");         return -1;     }     printf("***********************************************\n");     printf("学生信息和成绩如下\n");     printf("***********************************************\n");      for(int i=0;i<109;i++)     {         fscanf(fp1, "\n{%d,%d},", &stu[i][0], &stu[i][1]);           fscanf(fp2, "\n{%d,%d},", &stu[i][0], &stu[i][2]);           stu[i][3] = (stu[i][1]+stu[i][2])/2;         printf("学生:%d test成绩为:%d test5成绩为:%d 平均成绩为:%d\n", stu[i][0], stu[i][1],stu[i][2],stu[i][3]);     }      for(int i=0;i<109;i++){         for(int j=i+1;j<109;j++){             if(stu[i][3]<stu[j][3]){                 int no,t4,t5,ave;                 no = stu[i][0];                 t4 = stu[i][1];                 t5 = stu[i][2];                 ave = stu[i][3];                 stu[i][0] = stu[j][0];                 stu[i][1] = stu[j][1];                 stu[i][2] = stu[j][2];                 stu[i][3] = stu[j][3];                 stu[j][0] = no;                 stu[j][1] = t4;                 stu[j][2] = t5;                 stu[j][3] = ave;             }         }     }     printf("***********************************************\n");     printf("排序后学生平均成绩如下\n");     printf("***********************************************\n");     for(int i=0;i<109;i++){         printf("学生:%d  平均成绩为:%d\n", stu[i][0],stu[i][3]);     }     printf("***********************************************\n");     printf("不及格学生如下\n");     printf("***********************************************\n");     for(int i=0;i<109;i++){         if(stu[i][3]<50){             printf("学生:%d test成绩为:%d test5成绩为:%d 平均成绩为:%d\n", stu[i][0], stu[i][1],stu[i][2],stu[i][3]);         }     }     return 0; }

user: user-0
content: 有大佬无？可以私信我联系

user: user-0
content: 这是test4 {50218233  ,   70 }, {50219101  ,   90 }, {50219102  ,   60 }, {50219103  ,   75 }, {50219104  ,   80 }, {50219105  ,  100 }, {50219106  ,   95 }, {50219107  ,  100 }, {50219108  ,   75 }, {50219109  ,   80 }, {50219110  ,   80 }, {50219112  ,   65 }, {50219113  ,  100 }, {50219114  ,   55 }, {50219115  ,   75 }, {50219116  ,   95 }, {50219117  ,   90 }, {50219118  ,   55 }, {50219120  ,  100 }, {50219121  ,   75 }, {50219122  ,   75 }, {50219123  ,   80 }, {50219124  ,  100 }, {50219125  ,   80 }, {50219126  ,   65 }, {50219127  ,   70 }, {50219128  ,   90 }, {50219129  ,   90 }, {50219131  ,   30 }, {50219132  ,  100 }, {50219133  ,  100 }, {50219134  ,  100 }, {50219135  ,  100 }, {50219136  ,   90 }, {50219137  ,   60 }, {50219138  ,  100 }, {50219140  ,  100 }, {50219141  ,  100 }, {50219201  ,   90 }, {50219202  ,   95 }, {50219203  ,   75 }, {50219204  ,   95 }, {50219205  ,   95 }, {50219206  ,  100 }, {50219207  ,   80 }, {50219208  ,  100 }, {50219210  ,   85 }, {50219211  ,  100 }, {50219212  ,   85 }, {50219213  ,   95 }, {50219214  ,  100 }, {50219215  ,   85 }, {50219216  ,   50 }, {50219217  ,   90 }, {50219218  ,   80 }, {50219219  ,  100 }, {50219220  ,   90 }, {50219221  ,  100 }, {50219222  ,   90 }, {50219223  ,   95 }, {50219224  ,   95 }, {50219225  ,   90 }, {50219226  ,  100 }, {50219227  ,   95 }, {50219228  ,   90 }, {50219229  ,  100 }, {50219230  ,   50 }, {50219231  ,   80 }, {50219233  ,  100 }, {50219234  ,  100 }, {50219235  ,  100 }, {50219236  ,  100 }, {50219237  ,   75 }, {50219238  ,  100 }, {50219239  ,   65 }, {50219240  ,  100 }, {50519139  ,  100 }, {56119101  ,   90 }, {56119102  ,   90 }, {56119103  ,   80 }, {56119104  ,  100 }, {56119105  ,   90 }, {56119106  ,   70 }, {56119107  ,   90 }, {56119108  ,   90 }, {56119109  ,   90 }, {56119110  ,   25 }, {56119111  ,   95 }, {56119112  ,   30 }, {56119113  ,   90 }, {56119114  ,   95 }, {56119115  ,   40 }, {56119116  ,   80 }, {56119117  ,   70 }, {56119118  ,   65 }, {56119119  ,   95 }, {56119120  ,   80 }, {56119121  ,   50 }, {56119122  ,   85 }, {56119123  ,  100 }, {56119124  ,   90 }, {56119125  ,   90 }, {56119126  ,   95 }, {56119127  ,  100 }, {56119128  ,   95 }, {56119129  ,   50 }, {56119130  ,   95 }, {56119131  ,   80 }, {72419224  ,   45 },