1 / 26
文档名称:

图书管理系统.doc

格式:doc   大小:200KB   页数:26页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

图书管理系统.doc

上传人:联系 2017/7/26 文件大小:200 KB

下载得到文件列表

图书管理系统.doc

相关文档

文档介绍

文档介绍:#include <iostream>
#include <string>
using namespace std;
struct Reader
{
string name;
string number;
string dateBorrow;
string dataBack;
Reader *next;
};
struct Book
{
string title;
string writer;
int amount;
int curAmount;
float price;
string number;
Reader reader;
Book *next;
};
struct Type
{
string name;
int amount;
Book book;
Type *next;
};
struct Library
{
int amount;
int amountBorrowed;
Type type;
};
//书籍类别的插入,头结点后插入
void typeInsert(Type *t,string na)
{
Type *p = new Type;
p->name = na;
p->amount = 0;
p-> = NULL;
p->next = t->next;
t->next = p;
}
//对图书的分类进行初始化
void init(Library *l)
{
l->amount = 0;
l->amountBorrowed = 0;
l-> = NULL;
//插入4个书籍类别
typeInsert(&l->type,"TG");
typeInsert(&l->type,"TK");
typeInsert(&l->type,"TP");
typeInsert(&l->type,"TM");
}
void bookInsert(Book *b)
{
//创建节点
int n=0;
Book *p = new Book;
//输入书名
printf("Input Title:");
cin>>p->title;
//输入作者
printf("Input writer:");
cin>>p->writer;
//判断是否书籍已存在
while(b->next != NULL)
{
if(b->next->title ==p->title && b->next->writer == p->writer)
{
printf("The book existed\n");
b->next->amount+=1;
b->next->curAmount+=1;
printf("Entry finished\n");
n = 1;
}
b = b->next;
}
//输入价格
if(n == 0)
{
printf("Input price:");
cin>>p->price;
//输入图书编号
printf("Input number:");
cin>>p->number;
//读者链暂时为空
p-> = NULL;
p->amount = 1;
p->curAmount = 1;
//节点链入
p->next = NULL;
b->next = p;
}
}
void readerInsertNode(Reader *r)
{
//新建节点
Reader *p = new Reader;
//录入数据
printf("Input name:");
cin>>p->name;
printf("Input number:");
cin>>p->number;
printf("Input dateBorrow:");
cin>>p->dateBorrow;
printf("Input dateBack:");
cin>>p->dataBack;
//链入节点
while(r->next)
{
r = r->next;
}
p->next = NULL;
r->next = p;
}
void readerInsert(Book *b)
{
string title,writer;
int n = 0;
cout<<"你想为那本书籍添加借阅者?\n

最近更新

智能家居设备创业计划书 38页

春节期间的传统木偶和布袋戏表演 22页

春节习俗的文化自觉与社会责任 23页

春节习俗之问神签 23页

春节习俗与传统文化的文化认同 28页

新能源电动汽车的充电桩消防与安全 26页

新员工培训的目标和效果评估 29页

教育与培训行业课程研发技巧 31页

教师培训培养学生自主学习与跨学科综合能力的.. 27页

支原体肺炎的预防措施在农村地区的应用 23页

支原体肺炎的健康教育与宣传工作的评估与改进.. 28页

提升团队协作能力的关键策略培训课件 31页

推动企业创新与发展 29页

2024年藏蓝色和藏青色哪个更显年轻 4页

2024年蔬菜大棚承包合同 11页

掌握支原体肺炎防控的核心要点和技巧 23页

护理骨干竞聘演讲PPT课件的设计和风格选择 21页

护理骨干竞聘演讲PPT课件导入与导出操作 25页

2024年营销工作计划范文锦集10篇 37页

2024年营业员个人求职自我评价 4页

2024年药店辞职药师申请书范文简短 8页

2024年药店员工辞职报告经典 13页

2024年药学专业自荐信集合五篇 8页

建立消防安全防护与预防培训课件 34页

2024年药剂师自荐信8篇 10页

2024年荐购房合同书 24页

2024年荆棘鸟读后感必备(15篇) 18页

2024版义务教育课程标准 15页

人教鄂教版科学(六年级下册)全册知识点(2023年.. 10页

《探究二氧化碳与氢氧化钠溶液的反应》说课pp.. 17页