C/C++實(shí)現(xiàn)圖書(shū)信息管理系統(tǒng)
更新時(shí)間:2021年11月26日 09:48:49 作者:呆橘丶
這篇文章主要為大家詳細(xì)介紹了c/c++實(shí)現(xiàn)圖書(shū)信息管理系統(tǒng),文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
本文實(shí)例為大家分享了c/c++實(shí)現(xiàn)圖書(shū)信息管理系統(tǒng)的具體代碼,供大家參考,具體內(nèi)容如下
程序流程圖
源代碼
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <conio.h> #include <windows.h> #define N 100 struct type{ char ISBN[N];//ISBN編號(hào)(一般為13位) char bookName[N]; //書(shū)名 char subject[N];//科目 char editor[N];//主編 float price;//價(jià)格 char publish[N];//出版社 char date[N];//日期 int num;//數(shù)量 struct type *next; }Book; typedef struct type * BooksManage; void color(short x);//字體顏色 int password();//管理員密碼 void AdministratorMenu();//管理員菜單 void VisitorMenu();//游客菜單 void SaveBooksdata(BooksManage head);//將數(shù)據(jù)保存到文件中 void AddBooks(BooksManage *head);//添加圖書(shū)信息 void ReadBooksdata(BooksManage *head);//將數(shù)據(jù)從文件中讀取 void DelBooks_Subject(BooksManage head);//按所屬學(xué)科刪除圖書(shū)信息 void DelBooks_ISBN(BooksManage head);//按ISBN刪除圖書(shū)信息 void ModifyBooks(BooksManage head);//修改圖書(shū)信息 void FindBooks(BooksManage head);//查詢(xún)圖書(shū)信息 void PrintBooks(BooksManage head);//顯示所有圖書(shū)信息 void SumBooks(BooksManage head);//求全部圖書(shū)價(jià)值 int main() { color(10); printf("\t\t\t\t\t* * * * * * * * * * * * * *\n"); color(14); printf("\t\t\t\t\t* 題目:圖書(shū)信息管理系統(tǒng) *\n"); color(11); printf("\t\t\t\t\t* 班級(jí): *\n"); color(12); printf("\t\t\t\t\t* 組員 *\n"); color(11); printf("\t\t\t\t\t* 姓名 學(xué)號(hào) *\n"); color(10); printf("\t\t\t\t\t* 張三 100001 *\n"); color(11); printf("\t\t\t\t\t* 李四 100002 *\n"); color(14); printf("\t\t\t\t\t* 王五 100003 *\n"); color(12); printf("\t\t\t\t\t* 日期 : 2019.03.19 *\n"); color(10); printf("\t\t\t\t\t* * * * * * * * * * * * * *\n"); system("title 圖書(shū)信息管理系統(tǒng)"); color(10); BooksManage head = NULL; ReadBooksdata(&head); int choice,z,c; printf("\n\n\n"); printf("\t\t\t※※※※※※※※※※※※※※※※※※※※※※※※※※※※\n"); printf("\t\t\t\t\t\t歡迎光臨圖書(shū)信息管理系統(tǒng)\n"); printf("\t\t\t--------------------------------------------------------\n"); printf("\t\t\t\t\t\t【1】游客\n"); printf("\t\t\t\t\t\t【2】管理員\n"); printf("\t\t\t\t\t\t【3】退出系統(tǒng)\n"); printf("\t\t\t--------------------------------------------------------\n"); while(printf("\t\t\t\t\t\t請(qǐng)選擇身份:")&&scanf("%d",&c)!=EOF) { if(c==1) { VisitorMenu(); while (printf("\t\t\t\t\t\t請(qǐng)輸入選擇項(xiàng)(1-3):")&&scanf("%d",&choice)!=EOF) { switch (choice) { case 1: /*查詢(xún)圖書(shū)信息*/ FindBooks(head); break; case 2: /*顯示所有圖書(shū)信息*/ PrintBooks(head); break; case 3: /*返回登錄界面*/ main(); break; case 4: exit(0); default: printf("\t\t\t\t\t輸入錯(cuò)誤!!!\n"); system("pause"); break; } VisitorMenu(); } } else if(c==2) { z = password(); AdministratorMenu(); while (printf("\t請(qǐng)輸入選擇項(xiàng)(1-8):") && z == 1 && scanf("%d",&choice) != EOF) { switch (choice) { case 1: /*錄入圖書(shū)信息*/ AddBooks(&head); break; case 2: /*刪除圖書(shū)信息*/ int sign; system("cls"); color(10);printf("\t\t\t* * * * * * * * * * * * * * *\n"); color(11);printf("\t\t\t*---------------------------*\n"); color(12);printf("\t\t\t* 輸入選擇刪除圖書(shū)的方式 *\n"); color(14);printf("\t\t\t*---------------------------*\n"); color(11);printf("\t\t\t*【 1】按所屬學(xué)科刪除圖書(shū) *\n"); color(12);printf("\t\t\t*---------------------------*\n"); color(14);printf("\t\t\t*【 2】按圖書(shū)ISBN號(hào)刪除圖書(shū) *\n"); color(11);printf("\t\t\t*---------------------------*\n"); color(10);printf("\t\t\t* * * * * * * * * * * * * * *\n"); scanf("\t\t\t%d",&sign); if(sign == 1) DelBooks_Subject(head); else if(sign == 2) DelBooks_ISBN(head); break; case 3: ModifyBooks(head); break; case 4: FindBooks(head); break; case 5: PrintBooks(head); break; case 6: SumBooks(head); break; case 7: main(); break; case 8: SaveBooksdata(head); exit(0); default: printf("\t輸入錯(cuò)誤!!!\n"); system("pause"); break; } AdministratorMenu(); } } else if(c==3) exit(0); else { printf("\t\t\t輸入錯(cuò)誤!!!\n\n"); } } return 0; } /**管理員密碼*/ int password() { int i=0; char user[10]="admin"; char Code[10]="admin"; char getuser[10]; char Getskey[10]; while(1) { printf("\t\t\t請(qǐng)輸入賬號(hào):"); scanf("%s",getuser); printf("\t\t\t請(qǐng)輸入密碼:"); while(1) { Getskey[i]=getch(); /*getch()函數(shù)在頭文件conio.h中,函數(shù)作用為輸入的內(nèi)容不會(huì)在屏幕上顯示*/ if(Getskey[i]=='\r') /* \b = 退格鍵(backspace)*/ break; /* \r = 回車(chē)鍵(carrige return)*/ else if(Getskey[i]=='\b') { if(i==0) continue; printf("\b"); printf(" "); printf("\b"); i--; } else { printf("*"); i++; } } Getskey[i]='\0'; if(strcmp(user, getuser) == 0 && strcmp(Code, Getskey) == 0){ printf("\n\n\n\t\t\t密碼正確,請(qǐng)稍等"); printf("."); Sleep(300); printf("."); Sleep(300); printf("."); Sleep(300); printf("."); Sleep(300); printf("."); Sleep(300); printf("."); Sleep(300); return 1; } else { printf("\n\n\t\t\t賬號(hào)不存在或密碼輸入錯(cuò)誤,請(qǐng)重新輸入\n"); i = 0; } } } /**管理員菜單*/ void AdministratorMenu() { system("cls");//清屏 printf("\n\n\n\n\n"); printf("\t************************************************************\n"); printf("\t* *\n"); printf("\t* 歡迎來(lái)到圖書(shū)信息管理系統(tǒng) *\n"); printf("\t* *\n"); printf("\t* *\n"); printf("\t* 主菜單 *\n"); printf("\t* *\n"); printf("\t* 1.錄入圖書(shū)信息 *\n"); printf("\t* *\n"); printf("\t* 2.刪除圖書(shū)信息 *\n"); printf("\t* *\n"); printf("\t* 3.修改圖書(shū)信息 *\n"); printf("\t* *\n"); printf("\t* 4.查詢(xún)圖書(shū)信息 *\n"); printf("\t* *\n"); printf("\t* 5.顯示所有圖書(shū)信息 *\n"); printf("\t* *\n"); printf("\t* 6.全部圖書(shū)的總價(jià)值 *\n"); printf("\t* *\n"); printf("\t* 7.返回登錄界面 *\n"); printf("\t* *\n"); printf("\t* 8.保存數(shù)據(jù)并退出系統(tǒng) *\n"); printf("\t* *\n"); printf("\t************************************************************\n\n"); } /**游客菜單*/ void VisitorMenu() { system("cls"); printf("\n\n\n\n\n"); printf("\t************************************************************\n"); printf("\t* *\n"); printf("\t* 歡迎來(lái)到圖書(shū)信息管理系統(tǒng) *\n"); printf("\t* *\n"); printf("\t* *\n"); printf("\t* 主菜單 *\n"); printf("\t* *\n"); printf("\t* 1.查詢(xún)圖書(shū)信息 *\n"); printf("\t* *\n"); printf("\t* 2.顯示所有圖書(shū)信息 *\n"); printf("\t* *\n"); printf("\t* 3.返回登錄界面 *\n"); printf("\t* *\n"); printf("\t* 4.退出系統(tǒng) *\n"); printf("\t* *\n"); printf("\t************************************************************\n\n"); } /*將數(shù)據(jù)保存到文件中*/ void SaveBooksdata(BooksManage head) { BooksManage p; FILE *fp; fp = fopen("BooksDatabase.txt","w"); p = head->next; while(p->next != NULL){ fprintf(fp,"%s\t",p->ISBN); fprintf(fp,"%s\t",p->bookName); fprintf(fp,"%s\t",p->subject); fprintf(fp,"%s\t",p->editor); fprintf(fp,"%.2f\t",p->price); fprintf(fp,"%s\t",p->publish); fprintf(fp,"%s\t",p->date); fprintf(fp,"%d\n",p->num); p=p->next; } if(p->next == NULL){ fprintf(fp,"%s\t",p->ISBN); fprintf(fp,"%s\t",p->bookName); fprintf(fp,"%s\t",p->subject); fprintf(fp,"%s\t",p->editor); fprintf(fp,"%.2f\t",p->price); fprintf(fp,"%s\t",p->publish); fprintf(fp,"%s\t",p->date); fprintf(fp,"%d",p->num); } fclose(fp); return ; } /**將數(shù)據(jù)從文件中讀取*/ void ReadBooksdata(BooksManage *head) { int n; BooksManage s, p; FILE *fp; fp=fopen("BooksDatabase.txt","r"); if(NULL == fp) { head = NULL; return ; } *head = (BooksManage)calloc(1, sizeof(Book)); p = *head; while (!feof(fp)) { s = (BooksManage)calloc(1, sizeof(Book)); fscanf(fp,"%s",s->ISBN); /*為下個(gè)結(jié)點(diǎn)分配內(nèi)存空間 */ fscanf(fp,"%s",s->bookName); fscanf(fp,"%s",s->subject); fscanf(fp,"%s",s->editor); fscanf(fp,"%f",&s->price); fscanf(fp,"%s",s->publish); fscanf(fp,"%s",s->date); fscanf(fp,"%d",&s->num); p->next=s; /*保存該結(jié)點(diǎn)*/ p=p->next; /*切換到下一個(gè)結(jié)點(diǎn)*/ p->next=NULL; /*保證最后一個(gè)結(jié)點(diǎn)為NULL*/ } fclose(fp);/*關(guān)閉文件 */ return ; } /**字體顏色*/ void color(short x) { if(x>=0 && x<=15) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), x); else SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7); } /**添加圖書(shū)信息*/ void AddBooks(BooksManage *head) { int i; BooksManage p, s; system("cls"); if(*head == NULL) { *head = (BooksManage)calloc(1,sizeof(Book)); p = *head; } else { p = *head; while(p->next) p = p->next; } printf("\n\n\n"); printf("\t※※※※※※※※※※※※※※※※※※※※※※※※※※※※\n"); printf("\t\t\t請(qǐng)問(wèn)添加幾本書(shū):"); scanf("%d",&i); printf("\t--------------------------------------------------------\n"); while(i) { s = (BooksManage)calloc(1,sizeof(Book)); printf("\t\t\t請(qǐng)輸入ISBN號(hào):"); scanf("%s",s->ISBN); printf("\t--------------------------------------------------------\n"); printf("\t\t\t請(qǐng)輸入書(shū)名:"); scanf("%s",s->bookName); printf("\t--------------------------------------------------------\n"); printf("\t\t\t請(qǐng)輸入書(shū)本的所屬學(xué)科:"); scanf("%s",s->subject); printf("\t--------------------------------------------------------\n"); printf("\t\t\t請(qǐng)輸入主編:"); scanf("%s",s->editor); printf("\t--------------------------------------------------------\n"); printf("\t\t\t請(qǐng)輸入價(jià)格:"); scanf("%f",&s->price); printf("\t--------------------------------------------------------\n"); printf("\t\t\t請(qǐng)輸入出版社:"); scanf("%s",s->publish); printf("\t--------------------------------------------------------\n"); printf("\t\t\t請(qǐng)輸入出版日期:"); scanf("%s",s->date); printf("\t--------------------------------------------------------\n"); printf("\t\t\t請(qǐng)輸入數(shù)量:"); scanf("%d",&s->num); printf("\t--------------------------------------------------------\n"); printf("\n"); printf("\t--------------------------------------------------------\n"); i--; p->next = s; /*保存輸進(jìn)去的這個(gè)結(jié)點(diǎn)*/ p = p->next; /*切換到下一個(gè)結(jié)點(diǎn)*/ p->next = NULL; /*最后一個(gè)結(jié)點(diǎn)為NULL*/ } printf("\t\t\t圖書(shū)添加成功!!!\n"); system("pause"); } /*按所屬學(xué)科刪除圖書(shū)信息*/ void DelBooks_Subject(BooksManage head) { system("cls"); int flag=0; char name[100],ch[10]; BooksManage p, t; /**如果表頭為空 */ if(head == NULL || head->next == NULL) { printf("沒(méi)有記錄圖書(shū)信息!\n"); system("pause"); return; } p = head; printf("\n\n\n"); printf("※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※\n"); printf("請(qǐng)輸入要?jiǎng)h除的學(xué)科名字;"); scanf("%s",&name); printf("------------------------------------------------------------------------------------\n"); printf("ISBN\t書(shū)名\t所屬學(xué)科\t主編\t價(jià)格\t出版單位\t出版時(shí)間\t數(shù)量\n"); printf("------------------------------------------------------------------------------------\n"); while(p->next) { t=p; p=p->next; /*轉(zhuǎn)換到下一個(gè)結(jié)點(diǎn)*/ if(strcmp(name,p->subject)==0) { flag=1; printf("%s\t%s\t%s\t\t%s\t%.2f\t%s\t\t%s\t%d\n",p->ISBN,p->bookName,p->subject,p->editor,p->price,p->publish,p->date,p->num); break; } } if(flag==1) { printf("是否刪除該本圖書(shū)信息(y/n)"); scanf("%s",ch); printf("----------------------------------------------------------------------\n"); if(strcmp(ch,"Y") == 0 || strcmp(ch,"y") == 0) { t->next = p->next; free(p); printf("該書(shū)已刪除!\n"); } else return; } else if(flag == 0) printf("沒(méi)找到那本書(shū)!\n"); system("pause"); } /*按ISBN刪除圖書(shū)信息*/ void DelBooks_ISBN(BooksManage head) { system("cls"); int flag=0; char ch[10]; char ISBN[N]; BooksManage p, t; /**如果表頭為空 */ if(head == NULL || head->next == NULL) { printf("沒(méi)有記錄圖書(shū)信息!\n"); system("pause"); return; } p = head; printf("\n\n\n"); printf("※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※\n"); printf("請(qǐng)輸入要?jiǎng)h除圖書(shū)的ISBN號(hào);"); scanf("%s",ISBN); printf("------------------------------------------------------------------------------------\n"); printf("ISBN\t書(shū)名\t所屬學(xué)科\t主編\t價(jià)格\t出版單位\t出版時(shí)間\t數(shù)量\n"); printf("------------------------------------------------------------------------------------\n"); while(p->next) { t=p; p=p->next; /*轉(zhuǎn)換到下一個(gè)結(jié)點(diǎn)*/ if(strcmp(ISBN,p->ISBN)==0) { flag=1; printf("%s\t%s\t%s\t\t%s\t%.2f\t%s\t\t%s\t%d\n",p->ISBN,p->bookName,p->subject,p->editor,p->price,p->publish,p->date,p->num); break; } } if(flag==1) { printf("是否刪除該本圖書(shū)信息(y/n)"); scanf("%s",ch); printf("----------------------------------------------------------------------\n"); if(strcmp(ch,"Y") == 0 || strcmp(ch,"y") == 0) { t->next = p->next; free(p); printf("該書(shū)已刪除!\n"); } else return; } else if(flag == 0) printf("沒(méi)找到那本書(shū)!\n"); system("pause"); } /*修改圖書(shū)信息*/ void ModifyBooks(BooksManage head) { system("cls"); int flag=0; char name[100],ch[5]; BooksManage p, t; /* 如果表頭為空 */ if(head == NULL || head->next == NULL) { printf("沒(méi)有記錄圖書(shū)信息!\n"); system("pause"); return ; } p = head; printf("\n\n\n"); printf("※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※\n"); printf("請(qǐng)輸入要修改的書(shū)名:"); scanf("%s",name); printf("--------------------------------------------------------------------\n"); while(p->next) { p=p->next; /*切換到下一個(gè)結(jié)點(diǎn)*/ if(strcmp(name,p->bookName)==0) { flag = 1; t = p; printf("ISBN\t書(shū)名\t所屬學(xué)科\t主編\t價(jià)格\t出版單位\t出版時(shí)間\t數(shù)量\n"); printf("------------------------------------------------------------------------------------\n"); printf("%s\t%s\t%s\t\t%s\t%.2f\t%s\t\t%s\t%d\n",p->ISBN,p->bookName,p->subject,p->editor,p->price,p->publish,p->date,p->num); } } if(flag==1) { printf("--------------------------------------------------------------------\n"); printf("\t\t是否修改該本圖書(shū)信息(y/n):"); scanf("%s",ch); printf("\t--------------------------------------------------------------------\n"); if(strcmp(ch,"Y")==0||strcmp(ch,"y")==0) { int c; printf("\t\t【1】ISBN號(hào)\n"); printf("--------------------------------------------------------------------\n"); printf("\t\t【2】書(shū)名\n"); printf("--------------------------------------------------------------------\n"); printf("\t\t【3】所屬學(xué)科\n"); printf("--------------------------------------------------------------------\n"); printf("\t\t【4】主編\n"); printf("--------------------------------------------------------------------\n"); printf("\t\t【5】?jī)r(jià)格\n"); printf("--------------------------------------------------------------------\n"); printf("\t\t【6】出版社\n"); printf("--------------------------------------------------------------------\n"); printf("\t\t【7】出版日期\n"); printf("--------------------------------------------------------------------\n"); printf("\t\t【8】數(shù)量\n"); printf("--------------------------------------------------------------------\n"); printf("\t請(qǐng)輸入你要修改的內(nèi)容;"); scanf("%d",&c); printf("--------------------------------------------------------------------\n"); p = t; switch(c) { case 1: printf("\t請(qǐng)輸入ISBN號(hào):"); scanf("%s",p->ISBN); break; case 2: printf("\t請(qǐng)輸入書(shū)名:"); scanf("%s",p->bookName); break; case 3: printf("\t請(qǐng)輸入所屬學(xué)科:"); scanf("%s",p->subject); break; case 4: printf("\t請(qǐng)輸入主編:"); scanf("%s",p->editor); break; case 5: printf("\t請(qǐng)輸入價(jià)格:"); scanf("%f",&p->price); break; case 6: printf("\t請(qǐng)輸入出版社:"); scanf("%s",p->publish); break; case 7: printf("\t請(qǐng)輸入出版日期:"); scanf("%s",p->date); break; case 8: printf("\t請(qǐng)輸入數(shù)量:"); scanf("%d",&p->num); break; } printf("--------------------------------------------------------------------\n"); printf("\t修改成功!!!\n"); } } else if(flag == 0) printf("對(duì)不起,該書(shū)庫(kù)沒(méi)有該書(shū)\n"); system("pause"); } /**顯示所有圖書(shū)信息*/ void PrintBooks(BooksManage head) { BooksManage p; system("cls"); /**如果表頭為空 */ if(head == NULL || head->next == NULL) { printf("沒(méi)有記錄圖書(shū)信息!\n"); system("pause");//提示任意鍵繼續(xù) return ; } p = head->next; printf("\n\n\n"); printf("※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※\n"); printf(" 圖書(shū)列表\n"); printf("------------------------------------------------------------------------------------\n"); printf("ISBN\t書(shū)名\t所屬學(xué)科\t主編\t價(jià)格\t出版單位\t出版時(shí)間\t數(shù)量\n"); printf("------------------------------------------------------------------------------------\n"); do { printf("%s\t%s\t%s\t\t%s\t%.2f\t%s\t\t%s\t%d\n",p->ISBN,p->bookName,p->subject,p->editor,p->price,p->publish,p->date,p->num); p = p->next; }while(p!=NULL); system("pause"); } /**求全部圖書(shū)價(jià)值*/ void SumBooks(BooksManage head){ float sum = 0; system("cls"); BooksManage p; /* 如果表頭為空 */ if(head == NULL || head->next == NULL) { printf("\t\t\t\t沒(méi)有圖書(shū)信息!\n"); return; } for(p = head;p != NULL; p = p->next){ sum += p->price * p->num; } printf("\n\n\n\n\n\n"); printf("\t\t\t***********************************\n"); color(12);printf("\t\t\t* 全部圖書(shū)的總價(jià)值為:%.2f *\n",sum); color(10);printf("\t\t\t***********************************\n"); system("pause"); } /*查詢(xún)圖書(shū)信息*/ void FindBooks(BooksManage head) { system("cls"); int choose,flag = 0; BooksManage p; char b[100]; char ISBN[N]; /* 如果表頭為空 */ if(head == NULL || head->next == NULL) { printf("沒(méi)有記錄圖書(shū)信息!\n"); system("pause"); return ; } do { system("cls"); printf("\n\n\n"); printf("※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※\n"); printf("\t\t1.按書(shū)名查找\n"); printf("----------------------------------------------------------------------\n"); printf("\t\t2.按ISBN號(hào)查找\n"); printf("----------------------------------------------------------------------\n"); printf("\t\t返回主菜單(其他數(shù)字)\n"); printf("----------------------------------------------------------------------\n"); printf("\t\t請(qǐng)輸入您的選擇:"); scanf("%d",&choose); printf("----------------------------------------------------------------------\n"); p=head; if(choose == 1) { printf("輸入所查書(shū)名:"); scanf("%s",b); printf("----------------------------------------------------------------------\n\n"); while(p->next) { p=p->next; /*轉(zhuǎn)換到下一個(gè)結(jié)點(diǎn)*/ if(strcmp(b,p->bookName)==0) /*判斷是否找到并輸出*/ { flag=1; printf("※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※\n"); printf("ISBN\t書(shū)名\t所屬學(xué)科\t主編\t價(jià)格\t出版單位\t出版時(shí)間\t數(shù)量\n"); printf("------------------------------------------------------------------------------------\n"); printf("%s\t%s\t%s\t\t%s\t%.2f\t%s\t\t%s\t%d\n",p->ISBN,p->bookName,p->subject,p->editor,p->price,p->publish,p->date,p->num); } } if(flag==0) printf("不存在該信息\n"); } else if(choose==2) { printf("輸入所查ISBN號(hào):"); scanf("%s",ISBN); printf("----------------------------------------------------------------------\n\n"); while(p->next) { p=p->next; /*轉(zhuǎn)換到下一個(gè)結(jié)點(diǎn)*/ if(strcmp(p->ISBN,ISBN) == 0) /*判斷是否找到并輸出*/ { flag=1; printf("※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※\n"); printf("ISBN\t書(shū)名\t所屬學(xué)科\t主編\t價(jià)格\t出版單位\t出版時(shí)間\t數(shù)量\n"); printf("------------------------------------------------------------------------------------\n"); printf("%s\t%s\t%s\t\t%s\t%.2f\t%s\t\t%s\t%d\n",p->ISBN,p->bookName,p->subject,p->editor,p->price,p->publish,p->date,p->num); } } if(flag == 0) printf("不存在該信息\n"); } else return; system("pause"); }while(1); }
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
您可能感興趣的文章:
- C++實(shí)現(xiàn)簡(jiǎn)單的圖書(shū)管理系統(tǒng)
- C++實(shí)現(xiàn)圖書(shū)管理系統(tǒng)
- C++實(shí)現(xiàn)圖書(shū)管理系統(tǒng)課程設(shè)計(jì)
- C++順序表實(shí)現(xiàn)圖書(shū)管理系統(tǒng)
- C++實(shí)現(xiàn)圖書(shū)管理系統(tǒng)最新版
- C++利用鏈表實(shí)現(xiàn)圖書(shū)信息管理系統(tǒng)
- C++圖書(shū)管理系統(tǒng)程序源代碼
- C++實(shí)現(xiàn)圖書(shū)管理系統(tǒng)簡(jiǎn)易版
- C++編寫(xiě)實(shí)現(xiàn)圖書(shū)管理系統(tǒng)
- C++實(shí)現(xiàn)圖書(shū)管理系統(tǒng)源碼
相關(guān)文章
C++實(shí)現(xiàn)LeetCode(107.二叉樹(shù)層序遍歷之二)
這篇文章主要介紹了C++實(shí)現(xiàn)LeetCode(107.二叉樹(shù)層序遍歷之二),本篇文章通過(guò)簡(jiǎn)要的案例,講解了該項(xiàng)技術(shù)的了解與使用,以下就是詳細(xì)內(nèi)容,需要的朋友可以參考下2021-07-07C語(yǔ)言中打印特殊圖案的實(shí)現(xiàn)代碼
以下代碼實(shí)現(xiàn)了在C語(yǔ)言中打印特殊圖案的解決方法。需要的朋友參考下2013-05-05C語(yǔ)言實(shí)現(xiàn)循環(huán)打印星號(hào)圖形再鏤空
這篇文章主要介紹了C語(yǔ)言實(shí)現(xiàn)循環(huán)打印星號(hào)圖形再鏤空,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-11-11C語(yǔ)言素?cái)?shù)(質(zhì)數(shù))判斷的3種方法舉例
這篇文章主要給大家介紹了關(guān)于C語(yǔ)言素?cái)?shù)(質(zhì)數(shù))判斷的3種方法,質(zhì)數(shù)是只能被1或者自身整除的自然數(shù)(不包括1),稱(chēng)為質(zhì)數(shù),文中通過(guò)代碼介紹的非常詳細(xì),需要的朋友可以參考下2023-11-11