2022年c语言图书管理标准系统.docx
《2022年c语言图书管理标准系统.docx》由会员分享,可在线阅读,更多相关《2022年c语言图书管理标准系统.docx(59页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、精品学习资源#include #include #include #include #include #include #define Key_UP72#define Key_DOWN80#define Key_ENTER 28#define Key_N49#define Key_Y21#define LENsizeofstruct linklisttypedef struct book1/* 图书基本信息结构体 */char name20;char writer30 ;char type20 ;char num20 ;char time20 ;char press20;char editio
2、n20 ;char ISBN40 ;float price ;int count ;int lendnum ;bbasic ;/*图书资料基本信息:中图法分类号、图书编号、书名、作者(要考虑多个作者情形)、出版社、出版日期、 ISBN 、版次、定价、馆藏数、借阅数等;*/typedef struct book2/* 图书选购信息结构体 */char name20;char writer20 ;char time15 ;int num ;float price ;float money ;欢迎下载精品学习资源char bill 30 ;bpurchase;/*图书选购信息:书名、作者、选购日期、
3、选购数量、选购单价、选购金额、发票号码、图书编号等;*/typedef struct book3/* 图书借阅信息结构体 */*需要输入的信息 */ char name20;char person20 ;char company20 ;char num20 ;/* 借书证号 */ char btime15 ;/*运算可得信息 */char rtime15 ;char fine20 ;blend ;/*图书借阅信息:借阅人、借阅人所在单位、借书证号、所借书名、借阅日期、归仍日期、逾期罚款等;借阅期限为一个月,逾期1 天,罚款 1 角;*/struct linklistbbasic binfo ;
4、struct linklist *next ; ;int key ;void menu ;void _window ;void words ;void boxint,int,int,int; int _chooseint bot, int top ;void playint ;int readsum ;void add ;void addbook ;void addbuy ;欢迎下载精品学习资源void addborrow ;void manage ;struct linklist* create ;void modify ;void delete ;void insert ;void sea
5、rch;void searchname;void searchwriter ;void orderwbbasic binfo100;void orderwbbasic binfo100;int halfnint sum,bbasic binfo100,char *find;int halfwint sum,bbasic binfo100,char *find;void sta ;void blist ;void bmoney ;int mainvoidmenu;void menuint y ;_window ;words ;/* 显示窗口 */* 显示菜单文字 */y = choose7,19
6、;/* 光标 */playy ;/* 依据键盘值操作 */void _window/* 窗口初始化 */textbackgroundBLUE textcolorWHITE ;clrscr ;box1,1,24,80 ;欢迎下载精品学习资源void words/* 显示菜单文字 */textcolorWHITE ;gotoxy30,7 ;textbackgroundRED ;cprintfAdd Book info;textbackgroundBLUE ;gotoxy30,10 ;cprintfManage Book;gotoxy30,13 ;cprintfSearch Book ;gotoxy
7、30,16 ;cprintfBook Statistic;gotoxy30,19 ;cprintfExit;gotoxy35,22 ;textcolorLIGHTGRAY;textbackgroundBLUE ;cprintf Main Menu ;gotoxy25, 2 ;textcolorRED ;highvideo ;cprintfThe Library Managemnt Program;normvideo ;void boxint x,int y, int high, int width/* 画方框 */int i ;gotoxyx,y ;putchar0xda ;for i = 1
8、; i width - 1 ; i+putchar0xc4 ;putchar0xbf ;gotoxyx, y + high - 3 ;putchar0xc0 ;gotoxywidth, y + high - 3;putchar0xd9 ;for i = 1 ; i high - 1 ; i+gotoxyx,y+i ;putchar0xb3 ;欢迎下载精品学习资源gotoxyx + width -1, y+i;putchar0xb3 ;gotoxyx, y + high - 1 ;putchar0xc0 ;for i = 1; i width - 1 ; i+putchar0xc4 ;gotox
9、yx + 1, y + high - 3 ;for i = 1 ; i botupbary ;y = y - 3 ; ;break;欢迎下载精品学习资源case Key_DOWN:if y topdownbary ;y = y + 3 ; ;break;whileky .= Key_ENTER;return y;upbarint y/* 光标上移 */int i ;typedef struct texel_structunsigned char ch;unsigned char attr;texel ;texel t;fori=30 ; i=48 ;i+gettexti,y,i,y,&t ;t
10、.attr=0x1f ;puttexti,y,i,y,&t ;gettexti,y-3,i,y-3,&t;t.attr=0x4f ;puttexti,y-3,i,y-3,&t; ;gotoxy30,y-3 ;return;downbarint y/* 光标下移 */int i ;typedef struct texel_structunsigned char ch;unsigned char attr;texel ;texel t;欢迎下载精品学习资源fori=30 ; i=48 ;i+gettexti,y,i,y,&t ;t.attr=0x1f ;puttexti,y,i,y,&t ;get
11、texti,y+3,i,y+3,&t;t.attr=0x4f ;puttexti,y+3,i,y+3,&t; ;gotoxy30,y+3 ;return;void playint y/* 依据 y 的值选择操作 */switchycase7:add;break;case 10:manage;break;case 13:search;break;case 16:sta;break;case 19:exit1 ;default:printfError;exit0 ;void add/* 显示 选择增加那种类型的信息 的窗口 */int y ;_window ;gotoxy30,7 ;textbac
12、kgroundRED ;cprintfAdd Basic info;textbackgroundBLUE ;gotoxy30,10 ;cprintfAdd Purchase info;gotoxy30,13 ;cprintfAdd Borrow info;gotoxy30,16 ;欢迎下载精品学习资源cprintfBack ;gotoxy25, 2 ;textcolorRED ;highvideo ;cprintfThe Library Managemnt Program;normvideo ;gotoxy35,22 ;textcolorLIGHTGRAY;textbackgroundBLUE
13、 ;cprintf Add Book ;textbackgroundBLUE ;textcolorWHITE ;y=choose7,16 ;switchy/* 选择增加信息类型的函数*/case 7 :addbook;break;/* 增加图书基本信息*/ case 10:addbuy;break;/* 增加图书购买信息 */case 13:addborrow ;break;/* 增加图书借阅信息 */ case 16:menu;break;default:printfError;break;void addbook/* 增加图书基本信息*/int ky, sum = 0 ;FILE *fp
14、;bbasic binfo ;textbackgroundBLUE ;textcolorWHITE ;clrscr ;iffp = fopene:sum.dat,rb .= NULL/* 读取图书基本信息数量sum*/fread&sum,2,1,fp ;fclosefp ;if fp = fopene:addbook.dat,ab = NULLprintfcannot write the addbook.dat;欢迎下载精品学习资源doclrscr ;gotoxy2,2 ;cprintfPlease input the classfication of chinese library clas
15、sification:;scanf%s,&binfo.type;getchar;gotoxy2,4 ;cprintfPlease input the books number: ;scanf%s,&binfo.num;getchar;gotoxy2,6 ;cprintfPlease input the books name: ;scanf%s,&binfo.name ;getchar;gotoxy2,8 ;cprintfPlease input the books writer:;scanf%s,&binfo.writer;getchar;gotoxy2,10 ;cprintfPlease i
16、nput the the books press: ;scanf%s,&binfo.press ;getchar;gotoxy2,12 ;cprintfPlease input the books edition:;scanf%s,&binfo.edition;getchar;gotoxy2,14 ;cprintfPlease input the books publish time:;scanf%s,&binfo.time;getchar;gotoxy2,16 ;cprintfPlease input the price: ;scanf%f,&binfo.price;getchar;goto
17、xy2,18 ;cprintfPlease input the ISBN of the book:;scanf%s,&binfo.ISBN;getchar;gotoxy2,20 ;cprintfPlease input the count of books:;scanf%d,&binfo.count;getchar;欢迎下载精品学习资源gotoxy2,22 ;cprintfPlease input the lend number of the book:;scanf%d,&binfo.lendnum;getchar;gotoxy10,25 ;cprintfPress Nn to finish
18、add book or Press any key to add more book.;ky = key ;sum+;iffwrite&binfo,sizeofbbasic,1,fp .= 1clrscr ;printfcannot save the data. ;whileky .= Key_N;fclosefp ;if fp = fopene:sum.dat,wb = NULLprintfcannot save the sum of the book. ;getch;exit0 ;iffwrite&sum,2,1,fp .= 1printffail to write the sum.dat
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 2022 语言 图书 管理 标准 系统
限制150内