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

正文內容

數(shù)據(jù)結構課程設計報告—商品管理(編輯修改稿)

2024-10-14 02:30 本頁面
 

【文章內容簡介】 put the No.%d goods39。%s:\n,n,string4)。scanf(%f,amp。ptr1price)。 if(CHECK_COUNT) printf(請輸入正確的商品數(shù)量 !\n)。 }while(CHECK_COUNT)。 } ptr2next=NULL。 printf(輸入商品信息的操作完成,下面請進行保存 :)。 getch()。 return(head)。 } 輸出算法的實現(xiàn) void print( ) {int i=1。 printf(請輸入要輸出的家電的文件名 :)。 head=openfile( )。 if(head==NULL) return。 else printf( 輸 出結果如下 :\n)。 12 printf(家電編號 家電名稱 家電數(shù)量 家電單價 \n\n)。 ptr1=head。 do {printf(PRINT)。 ptr1=ptr1next。 if(i/10==1) /*超過十行換頁 */ {i=0。 printf(超過十行自動進行換頁 :\n)。 getch( )。 printf(家電編號 家電名稱 家電數(shù)量 家電單價\n\n)。 } i=i+1。 }while(ptr1!=NULL)。 printf(請返回到菜單進行其它操作 :)。 getch( )。 } 插入算法的實現(xiàn) COM * insert( ) {COM * ptr3。 char string1[ ]={家電編號 }。 char string2[ ]={家電名稱 }。 char string3[ ]={家電數(shù)量 }。 char string4[ ]={家電單價 }。 char judge[10]。 printf(請輸入要插入的家電的文件名 :)。 head=openfile()。 if(head==NULL) return(NULL)。 else 13 do { printf(請輸入要插入的家電的信息 :\n)。 if((ptr3=(COM*)malloc(LEN))==NULL) {printf(沒有足夠內存,無法創(chuàng)造節(jié)點 !)。 getch()。 } do {printf(Please input goods39。%s(0):\n,string1)。scanf(%ld,amp。ptr3num)。 if(ptr3num=0) {printf(輸入錯誤 !請重新選擇要插入的家電 \n)。 getch( )。 } printf(Please input goods39。%s:\n,string2)。scanf(%s,amp。(ptr3name))。 printf(Please input goods39。%s:\n,string3)。scanf(%d,amp。(ptr3count))。 printf(Please input goods39。%s:\n,string4)。scanf(%f,amp。(ptr3price))。 if(CHECK_COUNT2) printf(請輸入正確的 商品數(shù)量 !\n)。 }while(CHECK_COUNT2)。 getch( )。 printf(按家電價格升序插入 \n)。 ptr1=head。 if(head==NULL) {head=ptr3。ptr3next=NULL。} else {while((ptr3priceptr1price)amp。amp。(ptr1next!=NULL)) {ptr2=ptr1。 14 ptr1=ptr1next。} if(ptr3price=ptr1price) {if(head==ptr1)head=ptr3。 else ptr2next=ptr3。 ptr3next=ptr1。} else {ptr1next=ptr3。ptr3next=NULL。} } return(head)。 printf(\n 插入成功 !是否繼續(xù)插入 ?(yes or no):)。 scanf(%s,judge)。 }while(! strcmp(judge,yes))。 printf(插入成功 !\n)。 printf(請按’ enter‘鍵返回到菜單 \n)。 printf(并選擇 6進行保 存,否則你將丟失剛插入的信息 !\n)。 getch( )。 return(head)。 } 刪除算法的實現(xiàn) COM *delet( ) {char name[10]。 char judge[10]。 int sel。 int del_num。 printf(請輸入要刪除的家電的文件名 :)。 head=openfile( )。 if(head==NULL) return(NULL)。 else do 15 {do { printf(請輸入要刪除的家電的信息 :\n)。 printf( * \n)。 printf( * \n)。 printf(從 1和 2中選擇一個數(shù)字進行操作 :)。 scanf(%d,amp。sel)。 switch(sel) {case 1: printf(輸入家電編號 :)。 scanf(%d,amp。del_num)。 break。 case 2: printf(輸入家電名稱 :)。 scanf(%s,amp。name)。 break。 } }while(sel!=1amp。amp。sel!=2)。 ptr1=head。 if(ptr1num==del_num||(strcmp(ptr1name,name)==0)) { head=ptr1next。 printf(家電信息刪除成功 !\n)。 } else /*判斷是否是目標結點 */ { while(ptr1!=NULLamp。amp。ptr1num!=del_numamp。amp。strcmp(ptr1name,name)!=0) {ptr2=ptr1。 ptr1=ptr1next。 ptr1prior=ptr2。 } 16 if(ptr1num==del_num||(strcmp(ptr1name,name)==0)) {ptr2next=ptr1next。 ptr1nextprior=ptr1prior。 free(ptr1)。 printf(\n 家電信息刪除成功 !\n\n)。 } else printf(\n未發(fā)現(xiàn)該家電信息 !\n\n)。 } printf(繼續(xù)刪除 ?(yes or no):)。 scanf(%s,judge)。 }while(!strcmp(judge,yes))。 printf(刪除成功 !\n)。 printf(請返回到菜單進行其它操作 \n)。 printf(并選擇 6進行保存,否則你將丟失剛 剛進行操作的結果 !\n)。 getch( )。 return(head)。 } 查找算法的實現(xiàn) void search( ) {char name[10]。 char judge[10]。 int sel。 long int sel_num。 printf(請輸入要查找的家電的文件名 :)。 head=openfile( )。 if(head==NULL) return。 else do {do 17 { printf(請選擇查找的方式 :\n)
點擊復制文檔內容
公司管理相關推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1