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

正文內(nèi)容

算法分析與設(shè)計綜合實驗實驗報告[圖書信息管理系統(tǒng)]-資料下載頁

2024-11-13 13:50本頁面

【導(dǎo)讀】密碼正確,進入系統(tǒng);密碼錯誤,程序結(jié)束。退出系統(tǒng):在系統(tǒng)主菜單中輸入“0”,以退出系統(tǒng)。給定記錄數(shù),屏幕輸入若干記錄,并將數(shù)據(jù)存入磁盤文件中。else{printf("沒有對應(yīng)資料!列表輸出磁盤文件記錄,并顯示記錄序號與記錄總數(shù)。

  

【正文】 aim1[12]={圖書 },aim2[12]={讀者 },aim[12]。 list *t,*p。 FILE *fp。 //判斷目的 if(x==1)//圖書 { strcpy(aim,aim1)。 strcat(aim,\\)。 strcat(aim,圖書記錄 )。 strcat(aim,.txt)。 if((fp=fopen(aim,w))==NULL) { printf(打開失??! \n)。 return 1。 } p=linkhead。 for(。jlinklength。j++) { books[0]=pdata。 fprintf(fp,%s %s %s %s %s %s %d %d\n,books[0].ID,books[0].name,books[0].author,books[0].date,books[0].publish,books[0].sort,books[0].price,books[0].borrowed)。 t=p。 p=pnext。 free(t)。 } free(link)。 fclose(fp)。 } else if(x==2)//讀者 { strcpy(aim,aim2)。 strcat(aim,\\)。 strcat(aim,讀者記錄 )。 strcat(aim,.txt)。 if((fp=fopen(aim,w))==NULL) { printf(打開失??! \n)。 return 1。 } fclose(fp)。 } else {printf(錯誤 \n)。return 1。} return 0。 } 四、實驗主要結(jié)果 (附程序運行界面截圖 ) “算法分析與設(shè)計綜合實驗”實驗報告 第 23 頁 共 34 頁 “算法分析與設(shè)計綜合實驗”實驗報告 第 24 頁 共 34 頁 實 驗 報 告 6 一、實驗名稱:借還管理模塊設(shè)計 二、實驗內(nèi)容 查詢記錄、借閱圖書、歸還圖書 查詢功能子菜單: 1) 圖書查詢 —— 按指定條件查詢圖書 2) 讀者查詢 —— 按指定條件查詢讀者 3) 逾期查詢 —— 查詢逾期讀者信息 三、算法設(shè)計與核心代碼 int AskRecord() { int x,a=1。 while(a) “算法分析與設(shè)計綜合實驗”實驗報告 第 25 頁 共 34 頁 { printf( : \n)。 scanf( %d,amp。x)。 if(x==1) { ShowRecord(1)。 InquireRecord(1)。 } else if(x==2) { InquireRecord(2)。 } else if(x==3) { AskFor()。 } else { printf(Wrong!重新輸入 \n)。 x=0。 } if(x!=0) { } printf(是否繼續(xù)查詢記錄操作? \ \n)。 scanf( %d,amp。a)。 } return 0。 } int BorrowBook() { long len。 int n,i,y=0,t。 char buffer[4],ctime1[10],ctime2[10],num[4],name[20]。 /*初始化 */ctime1[0]=39。\039。ctime2[0]=39。\039。 strcat(ctime1,get_time(39。m39。,0))。//獲取當前時間 strcat(ctime2,get_time(39。m39。,2))。//借書期限為兩個月 FILE *fp,*ftp。 printf(請輸入本次借書數(shù)量: )。 scanf( %d,amp。n)。 if(+n3) { printf(借書額已滿,請還書后再借 \n)。 return 0。 } else “算法分析與設(shè)計綜合實驗”實驗報告 第 26 頁 共 34 頁 { for(i=0。in。i++) { if((fp=fopen(圖書 \\圖書記錄 .txt,r+))==NULL) { printf(打開失??! \n)。 return 1。 } //找到書籍并更改信息 printf(輸入書號: )。 scanf( %s,amp。buffer)。 while(fscanf(fp,%s %s %s %s %s %s %d %d,amp。books[0].ID,amp。books[0].name,amp。books[0].author,amp。books[0].date,amp。books[0].publish,amp。books[0].sort,amp。books[0].price,amp。books[0].borrowed)==8) { if(strcmp(books[0].ID,buffer)==0) { printf( 書號 書名 作者 日期 出版 類別 定價 是否借出 \n)。 printf( %s %s %s %s %s %s %d %d \n,books[0].ID,books[0].name,books[0].author,books[0].date,books[0].publish,books[0].sort,books[0].price,books[0].borrowed)。 if(books[0].borrowed==0) { fseek(fp,1,SEEK_CUR)。 fprintf(fp,1\n)。 y=1。 break。 } else { printf(書已借走,借書失?。?\n)。 return 0。 } } else fscanf(fp,%*[^\n])。 } if(y==0) { printf(沒有該書號對應(yīng)記錄 !\n)。 return 0。 } strcat([i]ID,books[0].ID)。 strcat([i]loandate,ctime1)。 strcat([i]returndate,ctime2)。 ++。 } if(==3) { =0。 } else =1。 //儲存讀者信息 if((ftp=fopen(讀者 \\讀者記錄 .txt,r+))==NULL) { printf(打開失敗! \n)。 return 1。 } while(1) { “算法分析與設(shè)計綜合實驗”實驗報告 第 27 頁 共 34 頁 len=ftell(ftp)。 fscanf(ftp,%s %s,amp。num,amp。name)。 if(strcmp(,name)==0) { fseek(ftp,(ftell(ftp)len),SEEK_CUR)。 fprintf(ftp,%s %s %s %s %d ,num,)。 for(i=0。i。i++) { fprintf(ftp,%s ,[i]ID)。 fprintf(ftp,%s ,[i]loandate)。 fprintf(ftp,%s ,[i]returndate)。 } fprintf(ftp,\n)。 break。 } fscanf(ftp,%*[^\n])。 } } fclose(ftp)。 fclose(fp)。 printf(借書成功! \n)。 ShowRecord(1)。 return 0。 } int ReturnBook() { long len,len1。 int i,y=0,t=1,a=1。 char buffer[4],buffer1[80],aim3[12]={Admin39。s},aim4[12]={User39。s},num[4],name[20]。 FILE *fp,*ftp,*fin,*fout。 printf(已借書數(shù)量: %d\n,)。 if(==0) { printf(無需還書 \n)。 return 0。 } printf(開始還書?? \n)。 //打印已借信息 if((fp=fopen(圖書 \\圖書記錄 .txt,r+))==NULL) { printf(打開失敗! \n)。 return 1。 } printf(已借書籍: \n)。 printf(序號 書號 書名 作者 日期 出版 類別 定價 是否借出 \n)。 for(i=0。i。i++) { printf( %d %s ,i+1,[i]ID)。 while(fscanf(fp,%s %s %s %s %s %s %d %d%*[^\n],amp。books[0].ID,amp。books[0].name,amp。books[0].author,amp。books[0].date,amp。books[0].publish,amp。books[0].sort,amp。books[0].price,amp。books[0].borrowed)==8) { “算法分析與設(shè)計綜合實驗”實驗報告 第 28 頁 共 34 頁 if(strcmp(books[0].ID,[i]ID)==0) { printf( %s %s %s %s %s %d %d \n,books[0].name,books[0].author,books[0].date,books[0].publish,books[0].sort,books[0].price,books[0].borrowed)。 } } } //修改讀者信息 //獲取 while(1)//開始還書操作 { lop: printf(輸入書號: )。 scanf( %s,amp。buffer)。 for(i=0。i。i++) { if(strcmp([i]ID,buffer)==0) { [i]ID[0]=39。\039。 [i]loandate[0]=39。\039。 [i]returndate[0]=39。\039。 y=1。 t=i。 i=。 } } if(y==0) { printf(未借此書 \n)。 goto lop。 } if((ftp=fopen(讀者 \\讀者記錄 .txt,r+))==NULL) { printf(打開失??! \n)。 return 1。 } len=ftell(ftp)。 fscanf(ftp,%s %s,amp。num,amp。name)。 if(strcmp(,name)==0) { 。 fseek(ftp,(ftell(ftp)len),SEEK_CUR)。 fprintf(ftp,%s %s %s %s %d ,num,)。 for(i=0。i。i++) { if(i!=t) { fprintf(ftp,%s ,[i]ID)。 fprintf(ftp,%s ,[i]loandate)。 fprintf(ftp,%s ,[i]returndate)。 } } fprintf(ftp,\n)。 “算法分析與設(shè)計綜合實驗”實驗報告 第 2
點擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1