【文章內(nèi)容簡(jiǎn)介】
p1 number p numberstrcpy p1 namep name strcpy p1 sexp sex p1 age p agep1 chineseRecord p chineseRecord p1 englishRecord p englishRecordp1 mathematicsRecord p mathematicsRecord p1 physicalRecord p physicalRecordp1 chemistryRecord p chemistryRecord p1 biologicalRecord p biologicalRecord break else p p next cout 要繼續(xù)查找嗎 yn cin flag while flag y flag n cout 輸入錯(cuò)誤請(qǐng)輸入 yn endl cin flag if flag n break p1 struct STUDENT malloc LEN while flag y p2 next NULL struct STUDENT w cout \n 所有被查找學(xué)生的 成績(jī) endl w headna if headna NULL cout setw 0 學(xué)號(hào) setw 8 姓名 setw 8 性別 setw 8 年齡 setw 8 語文 setw 8 英語 setw 8 數(shù)學(xué) setw 8 物理 setw 8 化學(xué) setw 8 生物 endl do cout setw 0 w number setw 8 w name setw 8 w sex setw 8 w age setw 8 w chineseRecord setw 8 w englishRecord setw 8 w mathematicsRecord setw 8 w physicalRecord setw 8 w chemistryRecord setw 8 w biologicalRecord endl w w next while w NULL char filename[20] cout 請(qǐng)輸入保存的文件名 cin filename ofstream fout filenameiosapp if fout cout 文件不能打開 endl else struct STUDENT p p headna fout setw 0 學(xué)號(hào) setw 8 姓名 setw 8 性別 setw 8 年齡 setw 8 語文 setw 8 英語 setw 8 數(shù)學(xué) setw 8 物理 setw 8 化學(xué) setw 8 生物 endl do fout setw 0 p number setw 8 p name setw 8 p sex setw 8 p age setw 8 p chineseRecord setw 8 p englishRecord setw 8 p mathematicsRecord setw 8 p physicalRecord setw 8 p chemistryRecord setw 8 p biologicalRecord endl p p next while p NULL cout 保存成功 endl cout 現(xiàn)在返回上一級(jí) endl foutclose else cout \n 沒有被查找的學(xué)生不會(huì)保存請(qǐng)確認(rèn) endl void FindNumber struct STUDENT headnu NULL long num struct STUDENT p struct STUDENT p1p2 char flag y p1 p2 struct STUDENT malloc LEN do p head cout 輸入你要查找的學(xué)號(hào) cin num while p NULL if p number num if headnu NULL p1 number p numberstrcpy p1 namep name strcpy p1 sexp sex p1 age p agep1 chineseRecord p chineseRecord p1 englishRecord p englishRecordp1 mathematicsRecord p mathematicsRecord p1 physicalRecord p physicalRecordp1 chemistryRecord p chemistryRecord p1 biologicalRecord p biologicalRecord headnu p1 break else p2 next p1 p2 p1 p1 number p numberstrcpy p1 namep name strcpy p1 sexp sex p1 age p agep1 chineseRecord p chineseRecord p1 englishRecord p englishRecordp1 mathematicsRecord p mathematicsRecord p1 physicalRecord p physicalRecordp1 chemistryRecord p chemistryRecord p1 biologicalRecord p biologicalRecord break else p p next cout 要繼續(xù)查找嗎 yn cin flag while flag y flag n cout 輸入錯(cuò)誤請(qǐng)輸入 yn endl cin flag if flag n break p1 struct STUDENT malloc LEN while flag y p2 next NULL struct STUDENT w cout \n 所有被查找學(xué)生的 成績(jī) endl w headnu if headnu NULL cout setw 0 學(xué)號(hào) setw 8 姓名 setw 8 性別 setw 8 年齡 setw 8 語文 setw 8 英語 setw 8 數(shù)學(xué) setw 8 物理 setw 8 化學(xué) setw 8 生物 endl do cout setw 0 w number setw 8 w name setw 8 w sex setw 8 w age setw 8 w chineseRecord setw 8 w englishRecord setw 8 w mathematicsRecord setw 8 w physicalRecord setw 8 w chemistryRecord setw 8 w biologicalRecord endl w w next while w NULL char filename[20] cout 請(qǐng)輸入保存的文件名 cin filename ofstream fout filenameiosapp if fout cout 文件不能打開 endl else struct STUDENT p p headnu fout setw 0 學(xué)號(hào) setw 8 姓名 setw 8 性別 setw 8 年齡 setw 8 語文 setw 8 英語 setw 8 數(shù)學(xué) setw 8 物理 setw 8 化學(xué) setw 8 生物 endl do fout setw 0 p number setw 8 p name setw 8 p sex setw 8 p age setw 8 p chineseRecord setw 8 p englishRecord setw 8 p mathematicsRecord setw 8 p physicalRecord setw 8 p chemistryRecord setw 8 p biologicalRecord endl p p next while p NULL cout 保存成功 endl cout 現(xiàn)在返回上一級(jí) endl foutclose else cout \n 沒有被查找的學(xué)生不會(huì)保存請(qǐng)確認(rèn) endl void FindClass struct STUDENT p char flag y char it do p head cout 請(qǐng)輸入要查找科目所對(duì)應(yīng)的序號(hào) endl cout 1語文 setw 12 2英語 setw 12 3數(shù)學(xué) setw 12 4物理 setw 12 5化學(xué) setw 12 6生物 endl cin it while it 1 it 2 it 3 it 4 it 5it 6 cout 輸入錯(cuò)誤請(qǐng)重新輸入 endl cin it switch it case 1 cout 語文單科成績(jī)表 endl cout setw 0 學(xué)號(hào) setw 8 姓名 setw 8 性別 setw 8 年齡 setw 8 語文 endl while p NULL cout setw 0 p number setw 8 p name setw 8 p sex setw 8 p age setw 8