没有合适的资源?快使用搜索试试~ 我知道了~
首页基于C语言实现图书管理信息系统设计
本文实例为大家分享了图书管理信息系统的设计与实现,供大家参考,具体内容如下 #include<stdio> #include<string> #define BookSize 100 #define BLHum 50 #define BLHnum 50 #define RRnum 50 /*主数据库文件*/ typedef struct { int bno; char bname[21]; int namenext; char author[9]; int authnext; char press[11]; int prenext; char sortno[4];
资源详情
资源评论
资源推荐
基于基于C语言实现图书管理信息系统设计语言实现图书管理信息系统设计
本文实例为大家分享了图书管理信息系统的设计与实现,供大家参考,具体内容如下
#include<stdio.h>
#include<string.h>
#define BookSize 100
#define BLHum 50
#define BLHnum 50
#define RRnum 50
/*主数据库文件*/
typedef struct {
int bno;
char bname[21];
int namenext;
char author[9];
int authnext;
char press[11];
int prenext;
char sortno[4];
int storenum;
int borrownum;
}BookRecType;
typedef struct {
BookRecType BookDbase[BookSize];
int len;
}BookDbaseFile;
/*书号索引文件*/
typedef struct {
int bno;
int RecNo;
}BidxRecType;
typedef struct {
BidxRecType BnoIdx[BookSize];
int len;
}BnoIdxFile;
/*书名链头索引文件*/
typedef struct {
char bname[21];
int lhead;
int RecNum;
}BNRecType;
typedef struct {
BNRecType LHFrecl[BLHum];
int len1;
}LHFile1;
/*作者链头索引文件*/
typedef struct {
char author[9];
int lhead;
int RecNum;
}BARecType;
typedef struct {
BARecType LHFrec2[BLHnum];
int len2;
}LHFile2;
/*出版社链头索引问件*/
typedef struct {
char press[11];
int lhead;
int RecNum;
}BPRecType;
typedef struct {
BPRecType LHFrec3[BLHnum];
int len3;
}LHFile3;
/*读者文件*/
typedef struct {
int rno;
char name[8];
int bn1;
int bn2;
}RRecType;
typedef struct {
RRecType ReadRec[RRnum];
int len;
}ReadFile;
/*借还书文件*/
typedef struct {
int rno;
int bno;
char date1[9];
char date2[9];
}BbookRecType;
typedef struct {
BbookRecType Bbook[BookSize];
int len;
}BbookFile;
/*追加一条图书记录建立相关文件*/
BookDbaseFile AppeDBaseRec(BookDbaseFile df)
{
int i;
printf("书号 书名 作者名 出版社 分类 藏书量\n");
scanf("%d%s", df.BookDbase[i].bno, df.BookDbase[i].bname);
scanf("%s%s", df.BookDbase[i].author, df.BookDbase[i].press);
scanf("%s %d", df.BookDbase[i].sortno, &df.BookDbase[i].storenum);
df.BookDbase[i].borrownum = 0;
return df;
}
/*修改书号索引表的设计*/
BnoIdxFile ChangeBnoIdxF(BookDbaseFile df, BnoIdxFile bif)
{
int i, j, k = 1;
i = df.len;
j = bif.len;
while (j >= 1)
{
if (df.BookDbase[i].bno>bif.BnoIdx[j].bno)
{
k = j + 1;
break;
}
j--;
}
if (bif.len>0)
for (j = bif.len; j >= k; j--)
bif.BnoIdx[j + 1] = bif.BnoIdx[j];
bif.BnoIdx[k].bno = df.BookDbase[i].bno;
bif.BnoIdx[k].RecNo = i;
bif.len++;
return bif;
}
/*修改书名索引以及书名链头索引的设计*/
LHFile1 ChangeLinkHeadF1(BookDbaseFile *df, LHFile1 lhf1)
{
int i, j, k, m;
char sm[21];
i = df->len;
strcpy(sm , df->BookDbase[i].bname);
j = 1;
k = 0;
while (j <= lhf1.len1)
{
if (strcmp(sm, lhf1.LHFrecl[j].bname) == 0)
{
k = j;
break;
}
j++;
}
if (k != 0)
{
df->BookDbase[i].namenext = lhf1.LHFrecl[k].lhead;
lhf1.LHFrecl[k].lhead = i;
lhf1.LHFrecl[k].RecNum++;
}
else
{
m = ++lhf1.len1;
df->BookDbase[i].namenext = 0;
lhf1.LHFrecl[m].lhead = i;
lhf1.LHFrecl[m].RecNum = 1;
strcpy(lhf1.LHFrecl[m].bname, sm);
}
return lhf1;
}
/*修改作者索引以及作者链头索引表的设计*/
LHFile2 ChangeLinkHeadF2(BookDbaseFile *df, LHFile2 lhf2)
{
int i, j, k, m;
char zz[9];
i = df->len;
strcpy(zz, df->BookDbase[i].author);
j = 1;
k = 0;
while (j <= lhf2.len2)
{
if (strcmp(zz, lhf2.LHFrec2[j].author) == 0)
{
k = j;
break;
}
j++;
}
if (k != 0)
{
df->BookDbase[i].authnext = lhf2.LHFrec2[k].lhead;
lhf2.LHFrec2[k].lhead = i;
lhf2.LHFrec2[k].RecNum = 1;
strcpy(lhf2.LHFrec2[m].author, zz);
}
return lhf2;
}
/*修改出版社的索引以及出版社链头索引表的设计*/
LHFile3 ChangeLinkHeadF3(BookDbaseFile *df, LHFile3 lhf3)
{
int i, j, k, m;
char cbs[11];
i = df->len;
strcpy(cbs, df->BookDbase[i].press);
j = 1;
k = 0;
while (j <= lhf3.len3)
剩余10页未读,继续阅读
weixin_38713717
- 粉丝: 6
- 资源: 932
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
- SPC统计方法基础知识.pptx
- MW全能培训汽轮机调节保安系统PPT教学课件.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0