1 / 12
文档名称:

C语言图书管理系统源代码.doc

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

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

分享

预览

C语言图书管理系统源代码.doc

上传人:Gebu 2021/11/16 文件大小:27 KB

下载得到文件列表

C语言图书管理系统源代码.doc

相关文档

文档介绍

文档介绍:C语言图书管理系统源代码
#include<> #include<> #include<>
#include<>
typedef struct
{ char name[10]; //姓名
char call[120]; //电话
char name1[20]; //书名
char numb[30]; //书号
}datatype;
typedef struct node {
datatype data;
struct node * next; }listnode;
typedef listnode * linklist;
linklist head;
listnode * p;
//图书馆用户信息的建立
linklist Create(int a ) {
linklist head=(listnode *)malloc(sizeof(listnode));
listnode *p,*q;
q=head;
while(a--)
{
p=(listnode *)malloc(sizeof(listnode));
printf("姓名 电话 书名 书号\n");
scanf("%s%s%s%s",p->,p->,p->,p->);
q->next=p;
q=p;
}
q->next=NULL;
return head;
}
//图书馆用户信息的添加
void Add(linklist head,int b)
{
listnode * m,* n,* p;
m=head;
n=m->next;
while(n->next!=NULL)
{
m=n;
n=n->next;
}
while(b--)
{
p=(listnode *)malloc(sizeof(listnode));
printf("姓名 电话 书名 书号\n");
printf("**********************\n");
scanf("%s%s%s%s",p->,p->,p->,p->);
n->next=p;
n=p;
}
n->next=NULL;
}
//按姓名查找用户信息
listnode * Find(linklist head) {
listnode *p;
char name[10];
int i;
printf("**********************\n");
printf("**********************\n");
printf("姓名查找,按1表示查找:");
p=head->next;
scanf("%d",&i);
if(i==1)
{
printf("请输入要查询的姓名:");
scanf("%s",&name);
while(p&&strcmp(p->,name)>0)
p=p->next;
if(p==NULL||strcmp(p->,name)<0)
p=NULL;
}
return p;
}
//按书名查找宾馆信息
listnode * Find1(linklist head) {
listnode *p;
char name1[20];
int i;
printf("**********************\n");
printf("**********************\n");
printf("书名查找,按1表示查找:");
p=head->next;
scanf("%d",&i);
if(i==1)
{
printf("请输入要查询的书名:");
scanf("%s",&name1);
while(p&&strcmp(p->,name1)>0)
p=p->next;
if(p==NULL||strcmp(p->,name1)<0)
p=NULL;
}
return p;
}
//按姓名信息的修改
void Alter(linklist head) {
listnode * p;
p= Find(head);