下载此文档

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


文档分类:IT计算机 | 页数:约16页 举报非法文档有奖
1/16
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/16 下载此文档
文档列表 文档介绍
小型图书管理系统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

小型图书管理系统C语言程序 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数16
  • 收藏数0 收藏
  • 顶次数0
  • 上传人sssmppp
  • 文件大小67 KB
  • 时间2021-02-25