// 圖書(shū)管理的實(shí)驗報告#include #include #include struct BOOK { int id,usr[10],total,store,days[10]; char name[30],author[20]; }books[100]; void page_title(char *menu_item) { printf("\n- %s -\n\n",menu_item); } void book_add(void) { int n; page_title("注冊"); for(n=0;n<100;n++) if(books[n].id==0) break; printf("序號:"); scanf("%d",&books[n].id); printf("書(shū)名:"); scanf("%s",&books[n].name); printf("作者:"); scanf("%s",&books[n].author); printf("數量:"); scanf("%d",&books[n].total); books[n].store=books[n].total; } int search_book(void) { int n,i; page_title("查找"); printf("請輸入圖書(shū)序號:"); scanf("%d",&i); for(n=0;n0) { printf("請輸入借書(shū)證序號:"); scanf("%d",&s); printf("請輸入可借天數:"); scanf("%d",&d); for(l=0;l<10;l++) { if(books[n].usr[l]==0) { books[n].usr[l]=s; books[n].days[l]=d; break; } } books[n].store--; } if(n!=-1&&books[n].store==0) printf("此書(shū)已經(jīng)全部借出.\n"); } /*借書(shū)的函數,首先調用找書(shū)函數*/ void book_in(void) { int n,s,l; page_title("還書(shū)"); if((n=search_book())!=-1&&books[n].store<books[n].total) { printf("借閱者圖書(shū)證列表:\n"); for(l=0;l<10;l++) if (books[n].usr[l]!=0) printf("[%d] - %d天\n",books[n].usr[l],books[n].days[l]); printf("請輸入借書(shū)證序號:"); scanf("%d",&s); for(l=0;l<10;l++) { if(books[n].usr[l]==s) { books[n].usr[l]=0; books[n].days[l]=0; break; } } books[n].store++; } if(n!=-1&&books[n].store==books[n].total) printf("全部入藏.\n"); } void book_del(void) { int n; page_title("注銷(xiāo)"); if((n=search_book())!=-1) books[n].id=0; printf("該書(shū)已注銷(xiāo).\n"); } void main(void) { char n; page_title("請選擇"); printf("1 注冊\n2 查找\n"); printf("3 借書(shū)\n4 還書(shū)\n5 注銷(xiāo)書(shū)"); printf("\n0 退出\n"); while(n=getchar()){ switch(n) { case '1' : book_add();break; case '2' :search_book();break; case '3' : book_out();break; case '4' : book_in();break; case '5' : book_del();break; case '0' :exit(0); }printf("\n\n請選擇\n1 注冊\n2 查找\n3 借書(shū)\n4 還書(shū)\n5 注銷(xiāo)書(shū)\n0 退出\n\n"); getchar(); } }。
親愛(ài)的老師:
你好!
我們這個(gè)有意義的借書(shū)活動(dòng)我們已經(jīng)布置好了,我們具體的”借書(shū)須知”,”閱覽須知”等等條列都弄好了,如果,您有需要的話(huà),我可以給你看看我們的要求.
老師,因為我們是剛剛開(kāi)始開(kāi)展這個(gè)活動(dòng),所以,如果有什么地方做的不太好就請多多請教,希望老師給我們的這次活動(dòng)提出寶貴的建議!謝謝.
老師,既然我們已經(jīng)開(kāi)展了這個(gè)活動(dòng),就一定要有個(gè)負責人吧,而且,如果我們管理的不好,把書(shū)弄丟了,那我們一定會(huì )自己負責!絕對不會(huì )因為這種小事情而去麻煩老師!
老師,請您相信我,相信我們一定會(huì )把這件事情做好的!
(把這一份交給老師,之后在把借書(shū)須知”,”閱覽須知”等等條列給老師過(guò)目,可能寫(xiě)的不太好,5分鐘寫(xiě)的! 祝你成功!)
聲明:本網(wǎng)站尊重并保護知識產(chǎn)權,根據《信息網(wǎng)絡(luò )傳播權保護條例》,如果我們轉載的作品侵犯了您的權利,請在一個(gè)月內通知我們,我們會(huì )及時(shí)刪除。
蜀ICP備2020033479號-4 Copyright ? 2016 學(xué)習?shū)B(niǎo). 頁(yè)面生成時(shí)間:3.438秒