没有合适的资源?快使用搜索试试~ 我知道了~
图书馆管理系统---c语言编写.doc
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 107 浏览量
2023-04-23
10:16:58
上传
评论
收藏 59KB DOC 举报
温馨提示
试读
16页
图书馆管理系统---c语言编写.doc
资源推荐
资源详情
资源评论
#include "stdio.h"
#include "stdlib.h"
#include "conio.h"
#include "string.h"
#include "math.h"
#define LEN sizeof(struct library)
#define LEN1 sizeof(struct reader)
#define NULL 0
struct library//图书馆构造体
{int shuhao,xcl;
char name[20],author[20],chuban[20];
struct library *next;
};
struct reader//读者构造体
{
int zhenghao;
char mingzi[20],riqi[20],zname[20];
struct reader *next;
};
void mainmenu() //显示主菜单
{ system ("cls");
printf("");
printf(" ####################");
printf(" 1.图书馆信息");
printf(" 2.借阅系统");
printf(" 3.退出系统");
printf(" 请按键选择,回车拟定");
printf(" ######################");
printf("");
return ;
}
void menu1() //显示图书馆信息菜单
{ system ("cls");
printf("");
printf(" ####################");
printf(" 1.采编入库");
printf(" 2.清除库存");
printf(" 3.图书查询");
printf(" 4.库存一览");
printf(" 5.返回上一层");
printf(" 请按键选择,回车拟定");
printf("\t\t\t\t#######################\n");
printf("\n");
return ;
}
void menu2() //显示查询菜单
{ system ("cls");
//printf("");
printf("\t\t\t\t#######################\n");
printf("\t\t\t\t 1.书号查询\n\n");
printf("\t\t\t\t 2.书名查询\n\n");
printf("\t\t\t\t 3.作者查询\n\n");
printf("\t\t\t\t 4.出版社查询\n\n");
printf("\t\t\t 请按键选择,回车拟定\n");
printf("\t\t\t\t#######################\n");
//printf("");
return ;
}
void main()//主函数,调用 main1
{void main1();
main1();}
void main1()//main1 函数
{void tsgxx();//声明
void jieshuxitong();//声明
char choose;
mainmenu();
scanf("%c",&choose);
switch(choose)//功能函数选择
{ case '1':tsgxx();break;
case '2':jieshuxitong();break;
case '3':system ("cls");printf("\n\n\n\n\n\n\n\n\n\t\t\t
Byebye...");printf("\n\n\n\n\n\n\n\n\n\t\t\t 欢 迎 使 用 本 软 件 !!! ");getch();exit(0);system
("cls");break;
}
}
void tsgxx()//图书馆信息函数
{ void tsjinku();
void shanchu();
void chaxunts();
void xianshikucun();//函数声明
char choose;
menu1();//调用菜单函数
scanf("%c",&choose);
scanf("%c",&choose);
for (;;)
switch(choose)//功能函数选择
{ case '1':tsjinku();break;
case '2':shanchu();break;
case '3':chaxunts();break;
case '4':xianshikucun();break;
case '5':main1();break;
}
}
int tjzs()//记录文本个数函数
{ FILE *fp;
int tshuhao=0,txcl=0,n;
char tname[20]={'\0'},tauthor[20]={'\0'},tchuban[20]={'\0'};
fp=fopen("library.txt","r");//打开文献
for (n=0;!feof(fp);n++)//逐个读文献
fscanf(fp,"%d %s %s %s %d",&tshuhao,tname,tauthor,tchuban,&txcl);
n--;
fclose(fp);//关闭文献
return (n);//返回个数
}
int tjdzzs()//记录文本个数函数
{ FILE *fp;
int zhenghao=0,n;
char mingzi[20]={'\0'},riqi[20]={'\0'},zname[20]={'\0'};
fp=fopen("reader.txt","r");//打开文献
for (n=0;!feof(fp);n++)//逐个读文献
fscanf(fp,"%d %s %s %s ",&zhenghao,&mingzi,&riqi,&zname);
fclose(fp);//关闭文献
return (n);//返回个数
}
void tsjinku()//图书进库函数
{ FILE *fp;
int shuhao=0,xcl=0,n=0;
char name[20]={'\0'},author[20]={'\0'},chuban[20]={'\0'};
char hitkey;
system ("cls");
if ((fp=fopen("library.txt","r"))==NULL)//打开图书馆文献,不存在此文献则新建
{ fp=fopen("library.txt","w");
剩余15页未读,继续阅读
资源评论
智慧安全方案
- 粉丝: 3651
- 资源: 59万+
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功