freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

數(shù)據(jù)結(jié)構(gòu)課程設(shè)計學(xué)生成績管理系統(tǒng)(編輯修改稿)

2025-05-09 06:52 本頁面
 

【文章內(nèi)容簡介】 //從鍵盤接收輸入數(shù)賦值給結(jié)點的英語成績 cout\n請輸入學(xué)生的計算機基礎(chǔ)成績:。 cinp3puter。 //從鍵盤接收輸入數(shù)賦值給結(jié)點的計算機成績 p3scoresum=p3math+p3english+p3puter。 //計算結(jié)點的總成績 p3next=NULL。 //將要插入結(jié)點的指針域設(shè)置為空 if(h==NULL) //當鏈表中沒有結(jié)點時,將要加入的結(jié)點作為頭結(jié)點 { h=p3。 return h。 } p1=p2=h。 while(p1!=NULLamp。amp。p3nump1num) //查找結(jié)點的學(xué)號大于要插入結(jié)點學(xué)號的第一個結(jié)點 //指針p1表示符合條件的結(jié)點的指針,指針p2是指針p1的前一個結(jié)點指針 { p2=p1。 p1=p1next。 } if(p1==h) //插入位置為頭結(jié)點前 { p3next=p3。 h=p3。 return h。 } else //插入位置為鏈表中間和鏈表尾部 { p2next=p3。 p3next=p1。 } studentSum+=1。 //學(xué)生人數(shù)加1 return h。 //返回鏈表的頭結(jié)點}void record::PrintRecord(SCORE * h){ if(h==NULL) { cout\n抱歉,沒有任何記錄!\n。 return。 } cout\n學(xué)號\t姓名\t數(shù)學(xué)\t英語\t計算機\t總分endl。 while(h) //輸出鏈表中每個結(jié)點的學(xué)生成績信息 { couthnum\thname\thmath\thenglish\thputer\thscoresumendl。 h=hnext。 }}struct SCORE * record::DeleteRecord(struct SCORE * h){ struct SCORE * p1,* p2。 int num。 if(h==NULL) //鏈表為空 { cout\n抱歉,沒有任何記錄!。 return h。 } p1=p2=h。 //將鏈表的頭結(jié)點指針h賦值給指針p1和指針p2 cout\n請輸入要刪除記錄的學(xué)生學(xué)號。 cinnum。 while(p1!=NULLamp。amp。p1num!=num) //查找結(jié)點的學(xué)號等于要刪除學(xué)生學(xué)號的第一個結(jié)點 //指針p1表示符合條件的結(jié)點的指針,指針p2是指針p1的前一個結(jié)點指針 { p2=p1。 p1=p1next。 } if(p1=NULL) //沒有找到符合要求的結(jié)點 { cout\n抱歉啊,表中沒有該記錄哦!。 return h。 } if(p1num==num) { studentSum=1。 //學(xué)生人數(shù)減1 if(p1==h) //刪除的是頭結(jié)點 h=hnext 。 else //刪除的是非頭結(jié)點 p2next=p1next。 delete p1。 //釋放p1 所指向的儲存單元 } return h。} struct SCORE * record::UpdateRecord(struct SCORE *h ){ struct SCORE * p1。 int num。 if(h==NULL) //鏈表為空 { cout\n抱歉,沒有任何記錄!。 return h。 } p1=h。 //將鏈表的頭結(jié)點指針h賦值給指針p1 cout\n請輸入要修改記錄的學(xué)生學(xué)號!。 cinnum。 while(p1!=NULLamp。amp。p1num!=num) //查找結(jié)點的學(xué)號等于要修改學(xué)生學(xué)號的指針結(jié)點 { p1=p1next。 //將p1指針移到下一個結(jié)點 } if(p1==NULL) //沒有找到符合要求的結(jié)點 { cout\n抱歉啊,表中沒有該記錄哦!。 return h。 } if(p1num==num) //找到符合要求的結(jié)點,并修改學(xué)生的相關(guān)成績 { cout\n請重新輸入學(xué)生的數(shù)學(xué)成績:。 cinp1math 。 cout\n請重新輸入學(xué)生英語成績:。 cinp1english 。 cout\n請重新輸入學(xué)生的計算機基礎(chǔ)成績:。 cinp1puter。 p1scoresum=p1math+p1english+p1puter。 } return h。}void record::FindRecord(struct SCORE * h,int x,float s1,float s2){ if(h==NULL) //鏈表為空 { cout\n抱歉,沒有任何記錄!。 return。 } cout \n學(xué)號\t姓名\t數(shù)學(xué)\t英語\t計算機\t總分endl。 while(h) { if(x==1) //查找數(shù)學(xué)成績在某分數(shù)段的學(xué)生成績信息 if(hmath=s1amp。amp。hmath=s2) couthnum\thname\thmath\th english\thputer\thscoresumendl。 if(x==2) //查找英語成績在某分數(shù)段的學(xué)生成績信息 if(henglish=s1amp。amp。henglish=s2) couthnum\thname\thmath\th english\thputer\thscoresum endl。 if(x==3) //查找計算機成績在某分數(shù)段的學(xué)生成績信息 if(hputer=s1amp。amp。henglish=s2) couthnum\thname\thmath\th english\thputer\thscoresum endl。 h=hnext。 }}void record::FindRecord(struct SCORE * h,int num) //根據(jù)學(xué)生學(xué)號查找學(xué)生成績信息{ struct SCORE * p1。 if(h==NULL) //鏈表為空 { cout\n抱歉,沒有任何記錄!。 return。 } p1=h。 //將鏈表的頭結(jié)點指針h賦值給指針p1 while(p1!=NULLamp。amp。p1num!=num) //查找節(jié)點的學(xué)號等于要查找學(xué)生學(xué)號的指針結(jié)點 { p1=p1next。 } if(p1==NULL) //沒有找到 { cout\n抱歉,表中沒有該記錄哦!。 return。 } if(p1num==num) //找到并顯示信息 { cout\n學(xué)號\t姓名\t數(shù)學(xué)\t英語\t計算機\t總分endl。 coutp1num\tp1name\tp1math\tp1 english\tp1puter\tp1scoresumendl。 }}void record::FindRecord(struct SCORE * h,string name) //根據(jù)學(xué)生姓名查找學(xué)生成績信息{ struct SCORE * p1。 if(h==NULL)
點擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1