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

正文內(nèi)容

車友信息管理系統(tǒng)程序設(shè)計(jì)(編輯修改稿)

2024-10-15 21:39 本頁面
 

【文章內(nèi)容簡(jiǎn)介】 (\n)。 count++。 } p=pnext。 } if(count==0) printf(it is not in the list!\n)。 return 0。 } struct node *InsertAfter(struct node *head,Type data) //尾部插入 { struct node *p,*p1。 p=(struct node*)malloc(size)。 //利用指針 p 申請(qǐng)動(dòng)態(tài)空間 pdata=data。 //數(shù)據(jù)域賦值 pnext=NULL。 //指針域直接賦值為空,因?yàn)樗切骆溩詈蟮慕Y(jié)點(diǎn) if(head==NULL) //如果鏈表原來為空 { head=p。 //修改頭指針 return head。 //返回頭指針 } p1=head。 //鏈表原來非空,則指針 p1 從頭指針開始 while(p1next) //如果指針還沒有指向鏈表的最后一個(gè)結(jié)點(diǎn)處 { p1=p1next。 //p1 順著鏈向后移動(dòng) } //循環(huán)停止時(shí), p1 指向了鏈表的最后一個(gè)結(jié)點(diǎn)處 p1next=p。 //將新結(jié)點(diǎn)連在 p1 之后 return head。 //返回頭指針 } struct node *InsertOrder(struct node *head,Type data,int condition) //有序插入法 { struct node *p,*p1,*p2。 p2=head。 p=(struct node*)malloc(size)。 //利用指針 p 申請(qǐng)動(dòng)態(tài)空間 pdata=data。 //數(shù)據(jù)域賦值 pnext=NULL。 //指針域直接賦值為空,以后根據(jù)插入位置再修改 if(head==NULL) //原鏈表為空時(shí)的插入 { head=p。 //新插入結(jié)點(diǎn)成為頭結(jié)點(diǎn) return head。 } //原鏈表不為空時(shí)的插入, larger 是一個(gè)通用函數(shù) while(p2amp。amp。larger(pdata ,p2data,condition)) //第一參數(shù)大于第二參 數(shù),返回真 { p1=p2。 //p1 是 p2 的前趨結(jié)點(diǎn),二者同時(shí)后移 p2=p2next。 } if(head==p2) //如果要在最前面插入,則要修改 head 指針 head=p。 else //否則 p 插在 p1 的后面 p1next=p。 pnext=p2。 //p2 作為 p 的后繼結(jié)點(diǎn),即 p 插在 p1 和 p2 之間 return head。 //返回頭指針 } struct node *CreateInsert() //按序插入法新建鏈表 { struct node *head。 Type data。 head=NULL。 printf(Input data end with 0:\n)。 readNode(amp。data)。 //調(diào)用 readNode 輸入一個(gè)結(jié)點(diǎn)的數(shù)據(jù)域的值 while(!endWith(data)) //endWith(data)函數(shù)值為真時(shí)結(jié)束鏈表結(jié)點(diǎn)的生成 { head=InsertOrder(head,data,1)。 //直接 InserOrder 函數(shù)插入新結(jié)點(diǎn) readNode(amp。data)。 //繼續(xù)讀入下一個(gè)結(jié)點(diǎn)的數(shù)據(jù)域的值 } return head。 //返回頭指針 } struct node *Delete(struct node *head,Type data) //刪除結(jié)點(diǎn) { struct node *p=head,*q=NULL。 if(head==NULL) //如果原來鏈表為空,則給出提示信息并返回 { printf(\nNo Records\n)。 return head。 } while(pamp。amp。!equal(pdata,data,1)) //如果鏈表非空,則從第 1 個(gè)結(jié)點(diǎn)開始比較 { q=p。 //如果沒有找到要?jiǎng)h除的結(jié)點(diǎn),則 p 和 q同時(shí)向后移 p=pnext。 //動(dòng)一個(gè)結(jié)點(diǎn)位置, q 始終是 p 的前趨 } if(p) //如果找到需要?jiǎng)h除的結(jié)點(diǎn) { if(q) //如果刪除的不是第一個(gè)結(jié)點(diǎn) qnext=pnext。 //修改的域,使 p 的后繼成為 q 的后繼 else //如果刪除的是第一個(gè)結(jié)點(diǎn)( q 保持初值 NULL) head=headnext。 //修改 head 指針 free(p)。 //釋放指針 p 所指向的結(jié)點(diǎn)空間 } else //如果沒有待刪除的點(diǎn) printf(it is not in the list.\n)。 //則輸出提示信息 return head。 //返回頭指針 } struct node *Recerse(struct node *head) //單鏈表的逆置 { struct node *p=head,*q。 //p 是當(dāng)前要處理的結(jié)點(diǎn)指針,從原 head 開始 head=NULL。 //head 置為空值 while(p) //用遍歷思想 { q=pnext。 //q 記下 p 的后繼結(jié)點(diǎn),便于下次繼續(xù)處理 pnext=head。 //修改 p 的 next 域,前趨變后趨 head=p。 //head 指向已逆置完成的新的第一個(gè)結(jié)點(diǎn)處 p=q。 //p 移向原鏈表的下一個(gè)結(jié)點(diǎn)處,再進(jìn)行處理 } return head。 //返回頭指針 } struct Carfriend { long VIPnum。 char name[10]。 char sex[7]。 char job[10]。 int age[2]。 char brand[10]。 char type[7]。 char colour[8]。 }。 typedef struct Carfriend Type。 const int sizeCfr=sizeof(Type)。 //車友信息所需要的內(nèi)存空間大小 struct node { Type data。 struct node *next。 }。 const int size=sizeof(struct node)。 //結(jié)點(diǎn)所需要的內(nèi)存空間的大小 include include void printHead() //打印表頭函數(shù) { printf(%8s%9s%9s%9s%7s%7s%13s%7s%7s\n,會(huì)員名 ,昵稱 ,性別 ,職業(yè) ,駕齡 ,年齡,車輛品牌 ,車款 ,顏色 )。 } void printNode(Type data) //輸出結(jié)點(diǎn)所有數(shù)據(jù)域的值 { int i。 printf(%8ld,)。 printf(%9s,)。 printf(%9s,)。 printf(%9s,)。 for(i=0。i2。i++) printf(%7d,[i])。 printf(%13s,)。 printf(%7s,)。 printf(%7s,)。 } void readNode(Type *pdata) //根據(jù)提示讀入結(jié)點(diǎn)的相關(guān)數(shù)據(jù)域的值 { int i。 printf(Input one carfriend\39。s information\n)。 printf(VIPnum: )。 scanf(%ld,amp。pdataVIPnum)。 printf(name: )。 scanf(%s,amp。pdataname)。 printf(sex: )。 scanf(%s,amp。pdatasex)。 printf(job: )。 scanf(%s,amp。pdatajob)。 printf(Input the driving years and the age of the carfriend\n)。 for(i=0。i2。i++) { scanf(%d,amp。pdataage[i])。 } printf(brand of the car: )。 scanf(%s,amp。pdatabrand)。 printf(type: )。 scanf(%s,amp。pdatatype)。 printf(colour of the car: )。 scanf(%s,amp。pdatacolour)。 } int endWith(Type data) //輸入結(jié)點(diǎn)數(shù)據(jù)時(shí)會(huì)員名域?yàn)?0 作為結(jié)束條件 { return ==0。 } int equal(Type data1,Type data2,int condition) { if(condition==1) if(strcmp(,)==0) return 0。 else return 1。 else if(condition==2) if(strcmp(,)==0) return 0。 else r
點(diǎn)擊復(fù)制文檔內(nèi)容
研究報(bào)告相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1