c/c++ 图书信息管理系统

来源:百度知道 编辑:UC知道 时间:2024/06/02 03:32:44
谁有c/c++版本的 图书信息管理系统 谢谢了,有实验报告最好

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct book{
char name[20],author[20],press[20];
int number,price;
struct book *next;
};
add()
{
FILE *fp;
struct book *head,*new,*current;
int i,n,k=0,j;
clrscr();
head=new=(struct book *)malloc(sizeof(struct book));
printf("How many books do you want to add?\n");
scanf("%d",&n);
getchar();
for(i=1;i<=n;i++)
{
printf("Please input name of%dst'book!\n",i);
fgets(new->name,20,stdin);
printf("Input the name of author!\n");
fgets(new->author,20,stdin);
printf("the name of press!\n");
fgets(new->press,20,stdin);
printf("THe price of book!Notice the price must be type of 'int'\n");
scanf("%d",&new->price);
printf("THe number