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

正文內(nèi)容

圖書館管理系統(tǒng)c語言課程設(shè)計報告(原創(chuàng))(編輯修改稿)

2024-09-03 11:38 本頁面
 

【文章內(nèi)容簡介】 ,先指向第一個結(jié)點,輸出p1所指的結(jié)點,然后使p1后移一個結(jié)點,再輸出,直到鏈表的尾結(jié)點。即將鏈表中所有信息輸出。void chaxun_all(struct book *head){ struct book *p。 p=head。 if (head!=NULL) { printf(書籍信息如下:\n\n)。 do { printf1_(p)。 p=pnext。 }while(p!=NULL)。 } printf(按Enter鍵繼續(xù))。 getchar()。}其他的查詢?yōu)樵阪湵碇羞M(jìn)行查找,查找到相匹配的就輸出信息。如//根據(jù)書名查詢圖書的信息void chaxun_name(struct book *head){ int i=0。 char a[N]。 struct book *p1。 printf(請輸入要查詢的書名:)。 scanf(%s,a)。 p1=head。 while(p1!=NULL) { if(strcmp(p1name,a)==0){ printf(查詢到的書籍信息如下:\n\n)。 printf1_(p1)。 i=1。 } p1=p1next。 } if(i==0) printf(沒有找到書名為 %s 的圖書!\n,a)。 getchar()。}l //用鏈表給書籍排序:按編號升序排序該函數(shù)按照圖書的編號用交換法進(jìn)行排序。struct book *num_order(struct book *head) { struct book *p1,*p2,*p3,*p4,*p5,*p6,*p7。 int x=1。 for(p1=head。p1next!=NULL。p4=p1,p1=p1next) { p3=p1。 for(p2=p1next,p5=p7=p2。p2!=NULL。p7=p2,p2=p2next) { if(strcmp(p3num,p2num)0) { p3=p2。 p5=p7。 } } if(p3!=p1) { if(xamp。amp。p1==head) { p6=p1next。 p1next=p3next。 p3next=p6。 p5next=p1。 head=p3。 p1=p3。 x=0。 } else { p6=p1next。 p1next=p3next。 p3next=p6。 p4next=p3。 p5next=p1。 p1=p3。 } } } printf(排序成功!\n)。 return head。 } l //統(tǒng)計書書籍總數(shù)int count(struct book *head){ int n=0。 struct book *p1。 for(p1=head。p1!=NULL。p1=p1next) n++。 return n。}l //將圖書信息插入到順序排放的鏈表中,插入后也是編號順序排放的。該函數(shù)有一個參數(shù),head頭結(jié)點指向鏈表的首地址,通過調(diào)用struct book * scanf1_() 函數(shù)得到圖書信息,然后按編號添加到鏈表上struct book *insert(struct book *head){ struct book *p1,*p2,*p3。 p1=scanf1_()。 p2=head。 p3=p2。 while(p2!=NULL amp。amp。 (strcmp(p2num,p1num)0) ) { p3=p2。 p2=p2next。 } if(p2==head) { p1next=head。 head=p1。 } else { p3next=p1。 p1next=p2。 } printf(插入成功!\n按Enter鍵繼續(xù)!\n)。 getchar()。 return head。}l //刪除圖書信息該函數(shù)根據(jù)輸入圖書的書名,在鏈表中進(jìn)行查找如果有匹配的,就將該書的信息刪除掉。最后返回刪除后的鏈表的頭結(jié)點。struct book *delete_(struct book *head){ char a[N]。 struct book *p1,*p2,*p3。 printf(請輸入要刪除的書名:)。 gets
點擊復(fù)制文檔內(nèi)容
規(guī)章制度相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1