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

正文內(nèi)容

c語(yǔ)言鏈表資料-資料下載頁(yè)

2025-06-30 16:41本頁(yè)面
  

【正文】 ain(){int number。char studname[20]。stud *head,*searchpoint。number=N。clrscr()。head=creat(number)。print(head)。printf(請(qǐng)輸入你要查找的人的姓名:)。scanf(%s,studname)。searchpoint=search(head,studname)。printf(你所要查找的人的姓名是:%s\n,*amp。searchpointname)。del(searchpoint)。print(head)。} 在這里列舉了一個(gè)應(yīng)用單鏈表基本算法的綜合程序,雙向鏈表和循環(huán)鏈表的綜合程序大家可以自己去試一試。include include include define N 10 typedef struct node{char name[20]。struct node *link。}stud。stud * creat(int n){stud *p,*h,*s。int i。if((h=(stud *)malloc(sizeof(stud)))==NULL){printf(不能分配內(nèi)存空間!)。exit(0)。}hname[0]=39。\039。hlink=NULL。p=h。for(i=0。iN。I++){if((s= (stud *) malloc(sizeof(stud)))==NULL){printf(不能分配內(nèi)存空間!)。exit(0)。}plink=s。printf(請(qǐng)輸入第%d個(gè)人的姓名,i+1)。scanf(%s,sname)。slink=NULL。p=s。}return(h)。}stud * search(stud *h,char *x){stud *p。char *y。p=hlink。while(p!=NULL){y=pname。if(strcmp(y,x)==0)return(p)。else p=plink。}if(p==NULL)printf(沒(méi)有查找到該數(shù)據(jù)!)。}stud * search2(stud *h,char *x){stud *p,*s。char *y。p=hlink。s=h。while(p!=NULL){y=pname。if(strcmp(y,x)==0)return(s)。else{p=plink。s=slink。}}if(p==NULL)printf(沒(méi)有查找到該數(shù)據(jù)!)。}void insert(stud *p){char stuname[20]。stud *s。if((s= (stud *) malloc(sizeof(stud)))==NULL){printf(不能分配內(nèi)存空間!)。exit(0)。}printf(\n請(qǐng)輸入你要插入的人的姓名:)。scanf(%s,stuname)。strcpy(sname,stuname)。slink=plink。plink=s。}void del(stud *x,stud *y){stud *s。s=y。xlink=ylink。free(s)。}void print(stud *h){stud *p。p=hlink。printf(數(shù)據(jù)信息為:\n)。while(p!=NULL){printf(%s ,amp。*(pname))。p=plink。}}void quit(){exit(0)。}void menu(void){clrscr()。printf(\t\t\t單鏈表C語(yǔ)言實(shí)現(xiàn)實(shí)例\n)。printf(\t\t|————————————————|\n)。printf(\t\t| |\n)。printf(\t\t| [1] 建 立 新 表 |\n)。printf(\t\t| [2] 查 找 數(shù) 據(jù) |\n)。printf(\t\t| [3] 插 入 數(shù) 據(jù) |\n)。printf(\t\t| [4] 刪 除 數(shù) 據(jù) |\n)。printf(\t\t| [5] 打 印 數(shù) 據(jù) |\n)。printf(\t\t| [6] 退 出 |\n)。printf(\t\t| |\n)。printf(\t\t| 如未建立新表,請(qǐng)先建立! |\n)。printf(\t\t| |\n)。printf(\t\t|————————————————|\n)。printf(\t\t 請(qǐng)輸入你的選項(xiàng)(16):)。}main(){int choose。stud *head,*searchpoint,*forepoint。char fullname[20]。while(1){menu()。scanf(%d,amp。choose)。switch(choose){case 1:head=creat(N)。break。case 2:printf(輸入你所要查找的人的姓名:)。scanf(%s,fullname)。searchpoint=search(head,fullname)。printf(你所查找的人的姓名為:%s,*amp。searchpointname)。printf(\n按回車(chē)鍵回到主菜單。)。getchar()。getchar()。break。case 3: printf(輸入你要在哪個(gè)人后面插入:)。scanf(%s,fullname)。searchpoint=search(head,fullname)。printf(你所查找的人的姓名為:%s,*amp。searchpointname)。insert(searchpoint)。print(head)。printf(\n按回車(chē)鍵回到主菜單。)。getchar()。getchar()。break。case 4:print(head)。printf(\n輸入你所要?jiǎng)h除的人的姓名:)。scanf(%s,fullname)。searchpoint=search(head,fullname)。forepoint=search2(head,fullname)。del(forepoint,searchpoint)。break。case 5:print(head)。printf(\n按回車(chē)鍵回到主菜單。)。getchar()。getchar()。break。case 6:quit()。break。default:printf(你輸入了非法字符!按回車(chē)鍵回到主菜單。)。clrscr()。menu()。getchar()。}}}(
點(diǎn)擊復(fù)制文檔內(nèi)容
化學(xué)相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1