在这只做简单的解释!假设有3个学生:FILE *fp; int i; if((fp=fopen(fp,"w"))==NULL) {printf("Cannot open the file!");exit(0); } for(i=0;i<3;i++) {fprintf(fp,"%d%s%f%f%f%f%f\n",struct.num,struct.name,struct.score[0],struct.score[1],struct.score[2],struct.score[3],struct.score[4]) ; }这里仅是简写,结构体的定义自己定义!这里... |