返回值:空 */
void write_text(struct Student stud[], int n) //将所有记录写入文件 {
int i = 0;
FILE *fp; //定义文件指针
/*char filename[20]; //定义文件名
printf(\请输入您要保存的文件名:\输入文件名 scanf(\
if ((fp = fopen(\打开文件 {
printf(\无法打开这个文件!\\n\\n\\n\ return; }
fprintf(fp, \循环写入数据 while (i < n) {
fprintf(fp,\%.1f %.1f %.1f %.1f\\n\stud[i].num, stud[i].name, stud[i].score[0], stud[i].score[1], stud[i].score[2], stud[i].score[3], stud[i].score[4]); i++; }
fclose(fp); //关闭文件
printf(\成功记录!\\n\\n\\n\返回成功信息 }
30