打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
图书管理员系统源码


图书管理员系统源码

图书管理员系统源码

#include


#include


#include


//书的结构体


struct book


{


char book_name[30];//书名 C语言


int bianhao;//书的编号


double price;//书的价格


char author[20];//作者


char state[20];//存在状态


char name[20];//待定


char sex[10];//待定


int xuehao;//学号


struct book* book_next;


};


//会员的结构体


struct club{


char name[20];//会员姓名


char sex[10];//会员性别


int xuehao;//会员学号


char borrow[30];//借书的状态


struct club *club_next;


};


//创建新的图书库,图书编号输入为0时结束


struct book* Create_New_Book();//函数的声明


//创建新的会员,会员学号输入为0时结束


struct club *Create_New_Club();


int main()


{


struct book* head_book;


struct club *head_club;


printf('\n欢迎你第一次进入图书管理系统\n\n');


printf('------>新建图书库\n\n');


printf('创建新的图书库,图书编号输入为0时结束\n\n');


head_book=Create_New_Book();


system('cls');


printf('\n欢迎您第一次进入图书管理系统!\n\n');


printf('----->[向导]----->[新建会员库]\n\n');


printf('注意:当输入会员学号为0时,进入主菜单.\n\n');


head_club=Create_New_Club();


system('cls');


return 0;


}


struct book* Create_New_Book()//函数的实现


{


struct book* head_book,*p_book;


int bianhao;


double price;


char book_name[30],author[20];


int size_book=sizeof(struct book);


head_book=NULL;


printf('请输入图书名称:');


scanf('%s',book_name);


printf('请输入图书编号:');


scanf('%d',&bianhao);


printf('请输入图书单价:');


scanf('%lf',&price);


printf('请输入作者名字:');


scanf('%s',author);


printf('\n');


while(bianhao!=0)


{


p_book=(struct book*)malloc(size_book);


strcpy(p_book->book_name,book_name);


p_book->bianhao=bianhao;


p_book->price=price;


strcpy(p_book->author,author);


p_book->xuehao=0;


strcpy(p_book->state,'存在');


strcpy(p_book->sex,'待定');


strcpy(p_book->name,'待定');




printf('请输入图书名称:');


scanf('%s',book_name);


printf('请输入图书编号:');


scanf('%d',&bianhao);


printf('请输入图书单价:');


scanf('%lf',&price);


printf('请输入作者名字:');


scanf('%s',author);


printf('\n');


}


return head_book;


}


struct club *Create_New_Club()


{


struct club *head_club,*p_club;


int xuehao;


char name[20],sex[10];


int size_club=sizeof(struct club);




head_club=NULL;


printf('请输入会员名字:');


scanf('%s',name);


printf('请输入会员性别:');


scanf('%s',sex);


printf('请输入会员学号:');


scanf('%d',&xuehao);


printf('\n');




while(xuehao!=0){


p_club=(struct club *)malloc(size_club);


strcpy(p_club->name,name);


strcpy(p_club->sex,sex);


p_club->xuehao=xuehao;


strcpy(p_club->borrow,'暂无');




printf('请输入会员名字:');


scanf('%s',name);


printf('请输入会员性别:');


scanf('%s',sex);


printf('请输入会员学号:');


scanf('%d',&xuehao);


printf('\n');


}


return head_club;


}

关于这个不明白的可以加群,因为时间来不及小编就发了部分文章呐!!!

 

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
C语言 图书管理系统
c语言例题
经典C语言程序设计100例81-90
c语言实习答案
《C语言程序设计》10 字符串写字字帖
最全的C\C 面试题解(2)
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服