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

正文內(nèi)容

用mysql數(shù)據(jù)庫實現(xiàn)的c圖書管理系統(tǒng)-展示頁

2025-05-25 19:39本頁面
  

【正文】 h(flag) { case 0: for(p=headbook。 } } } void BookManage::findbook(string s,int flag) { BookNode *p。 default: coutYELLOW輸入數(shù)字無效! NONEendl。 } } } if(pnext==NULL) coutYELLOW此書不存在! NONEendl。//從數(shù)據(jù)庫中刪除 //delete pnext。 totolbook=num。 break。p=pnext) { if(pnext==s) { if(pnext1) { pnext=num。amp。 } } else if(pnext) { for(p=headbook。 del_sql_book(p)。} else { headbook=pnext。 case 1: if(headbook==s) { if(headbook1) {headbook=num。 } } } if(pnext==NULL) coutYELLOW此書不存在! NONEendl。//從數(shù)據(jù)庫中刪除 //delete pnext。 totolbook=num。 break。p=pnext) { if(pnext==s) { if(pnext1) { pnext=num。amp。 } } else if(pnext) { for(p=headbook。 del_sql_book(p)。} 5 else { headbook=pnext。 if(headbook!=NULL) { switch(flag) { case 0: if(headbook==s) { if(headbook1) {headbook=num。 } else coutYELLOW輸入字符無效! NONEendl。 cinh。//添加至數(shù)據(jù)庫 BookManage::totolbook+=con。 headbook=p。 p=con。 cincon。 p=aut。 cout請輸入此書的作者: endl。 cinp1。 p=nu。 cout請輸入 ISBN編號: endl。 cinna。 BookNode *p=new BookNode。 else if(h==0) { 4 string na,nu,p1,aut。 if(h==1)return。 cout添加輸入 0,退出輸入 1endl。//查詢圖書 }。 void delbook(string s,int num,int flag)。 public: BookManage(){totolbook=0。//保存圖書信息到數(shù)據(jù)庫 void del_sql_book(BookNode *p)。 BookNode *headbook=NULL。 BookNode *next。 cout還有 book_con本書未借出! endl。 coutISBN編號: book_numendl。 cout出版社: book_preendl。 }。book_mux=0。//這樣的書還有幾本 int book_mux。//出版社 string book_aut。 string book_num。 /* 程序?qū)ёx: ,可通過書名,編號來進行 ,flag=0按書名來操作 ,flag=1按書編號來操作 ,也可通過姓名,用戶 ID 號或編號兩種方式來進行 ,flag=0 按姓名來操作 , flag=1按用戶 ID號或編號來操作 5個部分,具體已標識如( 1)圖書管理 ... ,,又可將數(shù)據(jù)保存至 mysql 數(shù)據(jù)庫,只 需稍加修改,具體如何修改,在此就不做說明 */ using namespace std。 char strSQL[200]。 char strPasswd[] = 3335599。 char strHost[] = localhost。 2 MYSQL_FIELD *fileds。 編譯時用如下命令: g++ $(mysql_config cflags) o t $(mysql_config libs) */ //定義 mysql數(shù)據(jù)庫變量 MYSQL mysql。 create table reader(stu_name varchar(20),stu_phone varchar(15),stu_password varchar(10),stu_num int,debt float,lend_time double,back_time double,count int)。34m /* 在編譯程序之前,請先開啟 mysql服務器(命令為 sudo mysqld_safe amp。31m define LIGHT_GREEN \033[1。34m define YELLOW \033[1。32m define BLUE \033[0。31m define GREEN \033[0。1 includefstream includeiostream include includectime includecmath include include sstream include include includemysql/ //改變字體顏色 define NONE \033[m define RED \033[0。32。32。32。33m define LIGHT_RED \033[1。32m define LIGHT_BLUE \033[1。),然后再登錄mysql客戶端(命令為 mysql u root p)建立數(shù)據(jù)庫 stu;建立數(shù)據(jù)表 reader, book;具體操作語句如下: create database stu。 create table book(book_name varchar(40),book_aut varchar(40),book_pre varchar(40),book_num int,book_mux int,book_con int)。 MYSQL_RES * results。 MYSQL_ROW rows。 char strUser[] = root。 char strDb[] = stu。 unsigned int num_fields。 class Book { public: string book_name。//編號 string book_pre。//作者 int book_con。//這樣的書總共有幾本 public: Book(){book_con=0。} void show_book()。 /**************************************** ( 1 ) 圖 書 管 理*******************************************/ void Book::show_book() { 3 cout書名: book_nameendl。 cout此書的作者: book_autendl。 cout此書共有 book_mux本 endl。 } class BookNode { public: Book book。 }。 void savebook(BookNode *p)。//將圖書信息從數(shù)據(jù)庫中刪除 class BookManage { public: int totolbook。} void addbook()。 void findbook(string s,int flag)。 void BookManage::addbook() { string h。 cinh。 else if(h==0) while(1) { if(h==1)break。int con。 cout請輸入書名: endl。 p=na。 cinnu。 cout請輸入出版社: endl。 p=p1。 cinaut。 cout請輸入此書共有幾本: endl。 p=con。 pnext=headbook。 savebook(p)。 cout繼續(xù)添加輸入 0,取消添加輸入 1endl。 } else coutYELLOW輸入字符無效! NONEendl。 } void BookManage::delbook(string s,int num,int flag) { BookNode *p=headbook。headbook=num。 totolbook=num。//從數(shù)據(jù)庫中刪除 //delete p。pnext!=NULLamp。p!=NULL。headbook=num。 } else { pnext=pnextnext。 del_sql_book(pnext)。 break。 } break。headbook=num。 totolbook=num。//從數(shù)據(jù)庫中刪除 6 //delete p。pnext!=NULLamp。p!=NULL。headbook=num。 } else { pnext=pnextnext。 del_sql_book(pnext)。 break。 } break。break。 int h=0。p!=NULL。 } if(NULL==p) coutYELLOW此書不存在! NONEendl。p!=NULL。 } if(h0) coutGREEN這種名字的書共有 h本 NONEendl。p!=NULL。//顯示出圖書的基本信息 if(p==0) coutYELLOW該書已全被借出! NONEendl。 } } break。p!=NULL。 if(p==0) coutYELLOW該書已全被借出! NONEendl。 } } if(NULL==p) coutYELLOW此書不存在! NONEendl。 default: coutYELLOW輸入數(shù)字無效! NONEendl。 } 8 } /**************************************** ( 2 ) 用 戶 管 理**********
點擊復制文檔內(nèi)容
研究報告相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1