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

正文內(nèi)容

c語言實(shí)習(xí)圖書信息管理系統(tǒng)報告(編輯修改稿)

2025-02-25 20:16 本頁面
 

【文章內(nèi)容簡介】 f((fp=fopen(,w))==NULL) return 0。 fprintf(fp,%d\n,num)。 for(i=0。inum。i++) { fprintf(fp,%d %s %s %d %s %s %d,P[i].sort,P[i].book_name, P[i].author_name,P[i].vert_number,P[i].publish_unit,P[i].publish_time,P[i].price)。 fprintf(fp,\n)。 } fclose(fp)。 return 1。 } 4. 3. 2 讀取 函數(shù) int get() { FILE *fp。 int i。 13 fp=fopen(,r)。 if(fp==NULL) return 0。 else { fscanf(fp,%d,amp。num)。 if(num0) { P=(B *)malloc(LEN * num)。 for(i=0。inum。i++) { fscanf(fp,%d%s%s%d%s%s%d,amp。P[i].sort,P[i].book_name, P[i].author_name,amp。P[i].vert_number,P[i].publish_unit,P[i].publish_time,amp。P[i].price)。 } fclose(fp)。 return 1。 } else { fclose(fp)。 return 0。 } } } 4. 3. 3 修改函數(shù) void modify() { int t,n,i,y=1。 int result,z,x。 t=get()。 if(t==0) { printf(\n \t 打開文件錯誤 ,無法修改 !)。 return。 } else if(y==1) { printf(\n\t 您要修改信息的圖書排列號為 (1%d): _\b\b,num)。 scanf(%d,amp。n)。 if(n=1amp。amp。n=num) { 14 for(i=0。inum。i++) { if(P[i].sort==n) { printf(\n\t 您即將修改以下信息 :\n)。 printf(\t\t 排列號 書名 作者名 序列號 出版單位 出版時間 價格 \n)。 printf(\t\t %d %s %s %d %s %s %d,P[i].sort,P[i].book_name, P[i].author_name,P[i].vert_number,P[i].publish_unit, P[i].publish_time,P[i].price)。 printf(\n\n\t 確認(rèn)請按 1。返回請按 2。返回上一層請按 3 _\b\b)。 scanf(%d,amp。x)。 if(x==1) { //p1=amp。boo。 printf(\t 您要將信息修改為 :\n)。 printf(\t\t 書名 : _\b\b)。 scanf(%s,p1book_name)。 printf(\t\t 作者名 : _\b\b)。 scanf(%s,p1author_name)。 printf(\t\t 序列號 : _\b\b)。 scanf(%d,amp。p1vert_number)。 printf(\t\t 出版單位 : _\b\b)。 scanf(%s,p1publish_unit)。 printf(\t\t 出版時間 : _\b\b)。 scanf(%s,p1publish_time)。 printf(\t\t 價格 : _\b\b)。 scanf(%d,amp。p1price)。 strcpy(P[i].book_name,p1book_name)。 strcpy(P[i].author_name,p1author_name)。 P[i].vert_number=p1vert_number。 strcpy(P[i].publish_unit,p1publish_unit)。 strcpy(P[i].publish_time,p1publish_time)。 P[i].price=p1price。 y=0。 z=1。 } else if(x==2) { 15 y=1。z=0。 } else { y=0。 f=1。 } } } } else { printf( \t 輸入錯誤 ,請重新輸入 :)。 y=1。 } while(z==1) { result=save()。 if(result==0) { printf(\n \t 修改信息失敗 !\n)。 z=0。 } if(result==1) { printf(\n \t 成功修改信息 !\n)。 z=0。 } } } return。 } 4. 3. 4 刪除函數(shù) void delet() { int t,n,i,j,y=1。 int result,z=0,x。 t=get()。 if(t==0) { printf(\n \t 打開文件錯誤 ,無法刪除 !)。 16 return。 } else while(y==1) { printf(\n\t 您要刪除信息的圖書排列號為 (1%d): _\b\b,num)。 scanf(%d,amp。n)。 if(n=1amp。amp。n=num) { for(i=0。inum。i++) { if(P[i].sort==n) { printf(\n\t 您即將刪除以下信息 :\n)。 printf(\t\t 排列號 書名 作者名 序列號 出版單位 出版時間 價格 \n)。 printf(\t\t %d %s %s %d %s %s %d,P[i].sort,P[i].book_name, P[i].author_name,P[i].vert_number,P[i].publish_unit, P[i].publish_time,P[i].price)。 printf(\n\n\t 確認(rèn)請按 1。返回請按 2。返回上一層請按 3 _\b\b)。 scanf(%d,amp。x)。 if(x==1) { for(j=i。jnum1。j++) { strcpy(P[j].book_name,P[j+1].book_name)。 strcpy(P[j].author_name,P[j+1].author_name)。 P[j].vert_number=P[j+1].vert_number。 strcpy(P[j].publish_unit,P[j+1].publish_unit)。 strcpy(P[j].publish_time,P[j+1].publish_time)。 P[j].price=P[j+1].price。 } num=num1。 y=0。 z=1。 } else if(x==2) { y=1。 } 17 else { y=0。 f=1。 } } } } else { printf( \t 輸入錯誤 ,請重新輸入 :)。 y=1。 } while(z==1) { result=save()。 if(result==0) { printf( \n\t 刪除信息失敗 !\n)。 z=0。 } if(result==1) { printf( \n\t 成功刪除信息 !\n)。 z=0。 } } } return。 } 5 程序代碼及運(yùn)行結(jié)果 5. 1 程序代碼 include include include define LEN sizeof(struct book) 18 typedef struct book { int sort。 char book_name[15]。 char author_name[15]。 int vert_number。 char publish_unit[15]。 char publish_time[10]。 int price。 }B。 B *P,*p1,boo。 int num=0,f=0。 int save()。 void input()。 int get()。 void output()。 void book_name()。 void author_name()。 void modify()。 void delet()。 int main() { int re=1,t,j=0。 int n,choice。 19 while(re==1) { t=1。
點(diǎn)擊復(fù)制文檔內(nèi)容
試題試卷相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1