【正文】
e score is %\n,aver)。 int i=0,num。 FILE *fp。 /*定義文件指針*/ printf(\t\t\tInput the filename:)。 scanf(\t\t\t%s,filename)。t open the file\n)。 printf(\t\t\t)。 /*讀入總記錄量*/ /*關閉文件*/}int i=0。 printf(\t\t\tcann39。 system(pause)。 } fclose(fp)。 /*返回成功信息*/}int n=0。 for(。 { switch(menu_select()) printf(\t\t\tInput Records\n)。 /*輸入若干條記錄*/ printf(\t\t\tDisplay All Records\n)。 /*顯示所有記錄*/ printf(\t\t\tSort\n)。 /*按學號排序*/ system(pause)。 case 4: /*插入一條記錄*/ break。 /*按姓名查找,刪除一條記錄*/ break。 /*查找并顯示一個記錄*/ break。 system(pause)。 case 8: printf(\t\t\tWrite to a Text file\n)。 system(pause)。 /*結束程序*/ exit(0)。 }} 輸入選項1,回車;每10個暫停顯示數(shù)據回到主菜單,輸入3,回車回到主菜單,輸入4,回車回到主菜單,輸入7,回車1回到主菜單,輸入0,回車退出系統(tǒng)。 出現(xiàn)統(tǒng)計信息 按提示插入一組數(shù)據 出現(xiàn)排序成功信息。回到主菜單;進入界面 printf(\t\t\t)。 case 9: printf(\t\t\tAdd Records from a Text File\n)。 Statistic(stu,n)。 printf(\t\t\t)。 Query_a_record(stu,n)。 printf(\t\t\t)。 n=Delete_a_record(stu,n)。 printf(\t\t\t)。 printf(\t\t\tInsert a Record\n)。 printf(\t\t\tSort Suceessed!\n)。 case 3: Display(stu,n)。 case 2: n=Input(stu,n)。 case 1: { /*選擇判斷*/ printf(Successed!\n)。 i++。 while(in) fprintf(fp,%d\n,n)。 { /*打開文件*/ if((fp=fopen(filename,w))==NULL) scanf(\t\t\t%s,filename)。 printf(\t\t\tInput the filename:)。 printf(\t\t\tWrite Records to a Text File\n)。char filename[20]。FILE *fp。 }stud[n+i].score)。 /*循環(huán)讀入數(shù)據*/num)。 return(n)。 /*打開失敗信息*/ /*輸入文件名*/ /*平均分*/}name:%s /*最高分*/if(stud[j].scorestud[i].score) j=i。 for(i=0。 }printf(\t\t\tnot find!\n)。 /*查找判斷*/amp。 /*交互式輸入*/ retur