【正文】
ead。 // creat head node headnext=NULL。 // get info from disk file if file existed while(1) { // 主菜單 printf(\n%s, ***** 學(xué)生信息管理系統(tǒng) ******\n * 1. 瀏覽學(xué)生信息 *\n * 2. 插入學(xué)生信息 *\n * 3. 刪除學(xué)生信息 *\n * 4. 修改學(xué)生信息 *\n * 5. 保存學(xué)生信息 *\n * 0. 退出系統(tǒng) *\n *****************************\n 請(qǐng)按功能代碼選擇(0 ~ 5):)。choice)。 // clear the return char from buffer switch(choice) { case 1: Browse(head)。 case 2: Insert(head)。 case 3: Delete(head)。 case 4: Modify(head)。 case 5: WriteInfo(head)。 case 0: Exit(head)。 default: printf(\n 選擇錯(cuò)誤,請(qǐng)重新輸入!\n)。}// 瀏覽學(xué)生信息void Browse(NODE *head) { NODE* p=head。 return。 printf(number name classes sex tel\n)。 while(p!=NULL) { printf(%s %s %s %s %s\n,pnumber,pname,pclasses,psex,ptel)。 }}void Insert(NODE *head) // 定義插入函數(shù){ NODE *t,*p。 // create a new node and pointed by t p=head。 scanf(%s,tnumber)。 scanf(%s,tname)。 scanf(%s,tsex)。 scanf(%s,tclasses)。 scanf(%s,ttel)。 // new node connect to head node tnext=NULL。 // new node insert to the