1 / 16
文档名称:

小型图书管理系统C语言程序.doc

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

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

分享

预览

小型图书管理系统C语言程序.doc

上传人:sssmppp 2021/2/25 文件大小:67 KB

下载得到文件列表

小型图书管理系统C语言程序.doc

相关文档

文档介绍

文档介绍:小型图书管理系统c语言程序
#include<> #include<> #include<> struct book
char writer[20];
char title[2O];
char publishinghouse[20];
char number[10];
float price;
struct book * next;
};
struct book * Create_Book();
void lnsert(struct book * head);
void Delete(struct book * head);
void Print_Book(struct book * head);
void search_book(struct book * head);
void change_Book(struct book * head);
void save(struct book * head);
struct book * Create_Book()
struct book * head;
head=(struct book *)malloc(sizeof(struct book));
head->next=NULL;
return head;
}
void save(struct book * head)
struct book *p;
FILE *fp;
p=head;
fp=fopen("","w+");
fprintf(fp,"吊号\t 吊名\t 作者\t出版社\t价箱At \n");
\n");
fprintf(fp,"
while(p->next!= NULL)
p=p->next;
fprintf(fp,"%s\t %s\t %s\t %s\t %.2f\t
\n",p->number,p->title,p->writer,p->publishinghouse,p->price);
fclose(fp);
printf("
\n");
〃插入//
void lnsert(struct book *head)
{
struct book *s, *p,*pl,*swap;
char flag='Y';
swap=(struct book *)malloc(sizeof(struct book));
pl=swap;
p=head;
while(flag=='Y'| |flag=='y')
{
s=(struct book *)malloc(sizeof(struct book));
printf("\n 铸输入圈吊吊号:”);
fflush(stdin);
scanf("%s",s->number);
printf("\n 铸输入圈吊吊名:”);
fflush(stdin);
scanf("%s",s->title);
printf("\n 铸输入圈吊作者名
fflush(stdin);
scanf("%s",s->writer);
printf("\n 铸输入圈吊出版社:”);
fflush(stdin);
scanf("%s",s->publishinghouse);
printf("\n 铸输入圈吊价箱■:");
fflush(stdin);
scanf("%f",&s->price);
printf("\n");
//#4//
pl=p->next;
if(head->next!=NULL)
do
{
if(strcmp((pl->number),(s->number))>O)
{
strcpy(swap->number,pl->number); strcpy(swap->title,pl->title); strcpy(swap->writer,pl->writer); strcpy(swap->publishinghouse,pl->publishinghouse); swap->price=pl->price;
strcpy(pl->number,s->number);
strcpy(pl->title,s->title); strcpy(pl->writer,s->writer); strcpy(pl->publishinghouse,s->publishinghouse);
pl->price=s->price; strcpy(s->number,swap->number); strcpy(s