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

正文內容

圖書館管理系統(tǒng)c代碼(已修改)

2025-09-24 10:09 本頁面
 

【正文】 include string//字符串頭文件 include fstream//文件頭文件 include iostream//是指標準庫中輸入輸出流的頭文件 , cout 就定義在這個頭文件里 using namespace std。//使用名字空間 std const int BMAX=50。 //書最多個數 //圖書管理模塊 //圖書類 class book { public: int no。 //圖書編號 char name[20]。 //圖書名稱 int b_flag。 //1 為在架, 2 為借出 int b_del。 //1 為存在 , 2 為刪除 public : book(){} //構造函 數 void setno(int n) { no=n。 //圖書編號取值 } int getno() { return no。 //返回圖書編號值 } void setname(char na[]) { strcpy(name, na)。 //字符串復制 } char* getname() { return name。 //返回圖書名稱 } void borbook() { b_flag=2。 //借書標志 } void delbook() { b_del=2。 //刪除標志 } void addbook(int no,char na[]) //增加圖書功能 { setno(no)。 setname(na)。 b_flag=1。 b_del=1。 } } 。 //圖書數據庫類 class bdatabase { public: book btarray[BMAX]。 //圖書集合 int top。 public: bdatabase() { book b。 top=1。 fstream file(,ios::in)。 //打開文件 while (1) { ((char *)amp。b,sizeof(b))。 if (!file) break。 top++。 btarray[top] = b。 } ()。 //關閉文件 } ~bdatabase() //析構函數, 將 btarray[]寫到 文件中 { fstream file(,ios::out)。 for (int i=0。i=top。i++) { if (btarray[i].b_del==1) ((char *)amp。btarray[i],sizeof(btarray[i]))。 } ()。 } void addbooks() //往圖書數據庫中加圖書 { book bk。 int no。 char bname[20]。 cout請輸入書號 : 。 cinno。 coutendl請輸入書名 : 。 cinbname。 coutendl。 =1。 (no, bname)。 top++。 btarray[top]=bk。 return。 } int findbooks(int suffix) //查找圖書,這個函數用于借書這書操作, suffix是數組下標 { int no。 cout請輸入書號 : 。 cinno。 for(int i=0。 i=top。 i++) { if(btarray[i].no==no amp。amp。 btarray[i].b_del==1) { return i。 } } return 1。 } int findbooks() //查找圖書 ,這個函數用于圖書維護 { int no。 char value[6]。 cout請輸入書號 : 。 cinno。 for(int i=0。 i=top。 i++) { if(btarray[i].no==no amp。amp。 btarray[i].b_del==1) { if(btarray[i].b_flag==1) strcpy(value,在架 )。 if(btarray[i].b_flag==2) strcpy(value,借出 )。 cout書號 : btarray[i].no 書的名稱 : btarray[i].name 圖書狀態(tài) :valueendl。 return i。 } } return 1。 } void editbooks() //編輯圖書 { int cur。 cur = findbooks()。 if (cur==1) { cout沒有這本書 endl。 return。 } cout書號 : btarray[cur].no 書的名稱 : btarray[cur].nameendl。 cout請修改數據: endl。 coutendl書的名稱 : 。 cinbtarray[cur].name。 return 。 } void delbooks()
點擊復制文檔內容
公司管理相關推薦
文庫吧 www.dybbs8.com
公安備案圖鄂ICP備17016276號-1