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

正文內容

圖書管理系統(tǒng)代碼-在線瀏覽

2025-05-25 23:05本頁面
  

【正文】 fprint(head)。 getchar()。 } break。 getchar()。 } } } break。 getchar()。 } }} //錄入數(shù)據(jù)并形成鏈表struct book *creatbook(){ struct book *head,*tail,*p。 char bname[50],wname[20],press[50],sort[50]。 int size=sizeof(struct book)。 printf(請輸入圖書編號:)。num)。 scanf(%s,bname)。 printf(請輸入作者名:)。 getchar()。 scanf(%s,press)。 printf(請輸入類別:)。 getchar()。 scanf(%d,amp。 getchar()。 scanf(%f,amp。 getchar()。 pnum=num。 strcpy(pwname,wname)。 strcpy(psort,sort)。 pprice=price。 if(head==NULL) head=p。 tail=p。 scanf(%d,amp。 n=yanzheng(head,num)。 else printf(您輸入的編號已存在,請重新輸入!\n)。 if(num==0) break。 scanf(%s,bname)。 printf(請輸入作者名:)。 getchar()。 scanf(%s,press)。 printf(請輸入類別:)。 getchar()。 scanf(%d,amp。 getchar()。 scanf(%f,amp。 getchar()。}//插入結點,并且插入后仍按一定順序struct book *addbook(struct book *head){ struct book *ptr,*p1,*p2,*p。 int size=sizeof(struct book)。 float price。 scanf(%d,amp。 n=yanzheng(head,num)。 else printf(您輸入的編號已存在,請重新輸入!\n)。 printf(請輸入圖書名:)。 getchar()。 scanf(%s,wname)。 printf(請輸入出版社:)。 getchar()。 scanf(%s,sort)。 printf(請輸入出版時間:)。time)。 printf(請輸入價格:)。price)。 p=(struct book *)malloc(size)。 strcpy(pbname,bname)。 strcpy(ppress,press)。 ptime=time。 p2=head。 while((ptrnump2num)amp。(p2next!=NULL)){ p1=p2。 } if(ptrnum=p2num){ if(head==p2) head=ptr。 pnext=p2。 pnext=NULL。}//驗證添加的圖書編號是否已存在int yanzheng(struct book *head,int m){ struct book *p。 while(p!=NULL){ if(pnum==m) break。 } if(p==NULL) return 0。}//將新鏈表寫入文件中void fprint(struct book *head){ FILE *fp。139。 if((fp=fopen(,w))==NULL){ printf(File open error!\n)。 } fputc(ch,fp)。p1。 } fclose(fp)。 char ch。 head=tail=NULL。 exit(0)。 if(ch==39。){ while(!feof(fp)){ p1=(struct book *)malloc(sizeof(struct book))。p1num,p1bname,p1wname,p1press,p1sort,amp。p1price)。 else tailnext=p1。 } tailnext=NULL。 return head。 }//將整個鏈表的信息輸出void print_book(struct book *head){ struct book *ptr。 return。 printf( ==========================================================\n)。 for(ptr=head。ptr=ptrnext) printf( %d %s %s %s %s %d %.2f\n,ptrnum,ptrbname,ptrwname,ptrpress,ptrsort,ptrtime,ptrprice)。}//刪除圖書信息void deletebook(struct book *head){ int a。139。 FILE *fp。 scanf(%d,amp。 p1=head。amp。 getchar()。b)。 switch(b){ case 39。: break。y39。 exit(0)。 printf(文件已清空!\n)。amp。 p1=p1next。 printf(是否確定從文件中徹底刪除該圖書?(y/n)\n)。 scanf(%c,amp。 switch(b){ case 39。: break。y39。 printf(刪除成功!\n)。 break。 getchar()。 printf(是否確定從文件中徹底刪除該圖書?(y/n)\n)。 scanf(%c,amp。 switch(b){ case 39。: break。y39。 printf(刪除成功!\n)。 break。 printf(是否確定從文件中徹底刪除該圖書?(y/n)\n)。 scanf(%c,amp。 switch(b){ case 39。: break。y39。 printf(刪除成功!\n)。 break。 printf( ==========================================================\n)。 printf( ** 3按圖書類別查詢 4按作者名查詢 **\n)。 printf( ==========================================================\n)。 scanf(%d,amp。 getchar()。 case 1: num_chaxun(head)。 case 2: bname_chaxun(head)。 case 3: sort_chaxun(head)。 case 4: wname_chaxun(head)。 case 5: time_chaxun(head)。 default: printf(您的輸入有誤!\n)。 }}//按編號查詢圖書信息void num_chaxun(struct book *head){ int a。 printf(請選擇您要查詢的圖書編號:)。a)。 p=head。 p=pnext。 } else{ printf( 你所查詢的圖書信息如下\n)。 printf( ** 編號 圖書名 作者名 出版社 類別 出版時間 價格 **\n)。 printf( =========================================================================\n)。 int flag=0。 printf(請選擇您要查詢的圖書名:)。 p=head。 break。 } if(flag==0){ printf(沒有找到該圖書名的圖書!\n)。 printf( =========================================================================\n)。 while(p!=NULL){ if(strcmp(pbname,a)==0){ printf( ** %d %s %s %s %s %d %.2f **\n,pnum,pbname,pwname,ppress,psort,ptime,pprice)。 } printf( =========================================================================\n)。 int flag=0。 printf(請選擇您要查詢的圖書作者名:)。 p=head。 break。 } if(flag==0){ printf(沒有找到該圖書名的圖書!\n)。 printf( =========================================================================\n)。 while(p!=NULL){ if(strcmp(pwname,a)==0){ printf( ** %d %s %s %s %s %d %.2f **\n,pnum,pbname,pwname,ppress,psort,ptime,pprice)。 }
點擊復制文檔內容
公司管理相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1