【文章內(nèi)容簡(jiǎn)介】
{ case 1:head=create()。break。 case 2:print(head)。break。 case 3:search(head)。break。 case 4:head=delete(head)。break。 case 5:head=sort(head)。break。 case 6:head=insert(head,amp。new)。break。 /*amp。new表示返回地址*/ case 7:save(head)。break。 case 8:head=load()。 break。 case 9:exit(0)。 /*如菜單返回值為9則程序結(jié)束*/ } }}/*初始化函數(shù)*/STUDENT *init(){return NULL。 /*返回空指針*/}/*菜單選擇函數(shù)*/menu_select(){int n。struct date d。 /*定義時(shí)間結(jié)構(gòu)體*/getdate(amp。d)。 /*讀取系統(tǒng)日期并把它放到結(jié)構(gòu)體d中*/printf(press any key to enter the menu......)。 /*按任一鍵進(jìn)入主菜單*/getch()。 /*從鍵盤讀取一個(gè)字符,但不顯示于屏幕*/clrscr()。 /*清屏*/printf(********************************************************************************\n)。printf(\t\t Wele to\n)。printf(\n\t\t The student score manage system\n)。printf(*************************************MENU***************************************\n)。printf(\t\t\t1. Enter the record\n)。 /*輸入學(xué)生成績(jī)記錄*/printf(\t\t\t2. Print the record\n)。 /*顯示*/printf(\t\t\t3. Search record on name\n)。 /*尋找*/printf(\t\t\t4. Delete a record\n)。 /*刪除*/printf(\t\t\t5. Sort to make new a file\n)。 /*排序*/printf(\t\t\t6. Insert record to list\n)。 /*插入*/printf(\t\t\t7. Save the file\n)。 /*保存*/printf(\t\t\t8. Load the file\n)。 /*讀取*/printf(\t\t\t9. Quit\n)。 /*退出*/printf(\n\t\t Made by Hu Haihong.\n)。printf(********************************************************************************\n)。printf(\t\t\t\t%d\\%d\\%d\n,)。 /*顯示當(dāng)前系統(tǒng)日期*/do{ printf(\n\t\t\tEnter your choice(1~9):)。 scanf(%d,amp。n)。 }while(n1||n9)。 /*如果選擇項(xiàng)不在1~9之間則重輸*/ return(n)。 /*返回選擇項(xiàng),主函數(shù)根據(jù)該數(shù)調(diào)用相應(yīng)的函數(shù)*/} {printf(\nOut of memory.)。 /*輸出內(nèi)存溢出*/ return (head)。 /*返回頭指針,下同*/ } printf(Enter the num(0:list end):)。 scanf(%s,pnum)。 if(pnum[0]==39。039。) break。 /*如果學(xué)號(hào)首字符為0則結(jié)束輸入*/ printf(Enter the name:)。 scanf(%s,pname)。 printf(Please enter the %d scores\n,3)。 /*提示開始輸入成績(jī)*/ s=0。 /*計(jì)算每個(gè)學(xué)生的總分,初值