求大神帮忙做一个c语言,一个图书管理系统的程序,急!!!!

2025-04-13 20:50:59
推荐回答(2个)
回答1:

#include
#include
#include
#include

//defining the properties of the fields used in the program


#define IN 1
#define OUT 0


void Addbook();
void Searchbook();
void Displaybook();
void Author();
void Titlelist();
void Stock();
void Issue();
void bookret();
void Addmembr();
void Exit();

char info[500];


struct
{
  int bid;
  char bname[25] ;
  char author[25];
  int nooftitles;
  char titles[500];
  int status;
}book;
struct
{
  int mid;
  char mname[25] ;
  char department[25];
  int availibcard;
  int phno;

}membr;


//initializing the files used in the program

FILE *librecord;
FILE *membrrecord;
FILE *fp1;
FILE *fp2;
FILE *temp1;
FILE *temp2;
int main()
{       
    int choice=0,i;
   
    printf("\n\t\t<>(Beta version ) \n");
    do{
    printf("\n\t~~MENU~~\n 1> Add A New Book\n 2> Search a book \n 3> Display Complete Information\n 4> Display All Books of An Author\n 5> List Titles of a Book\n 6> List Count of Books (Issued & On Stock)\n 7> To Issue a Book \n 8> To Rreturn a Book \n 9> Add A New Member\n 10> Exit the program\n\n\t Enter your choice <1-10>: ");
    scanf("%i",&choice);

       
    switch (choice)
    {   
        case 1:
            Addbook();
            break;
        case 2:
            Searchbook();
            break;
        case 3:
            Displaybook();
            break;
        case 4:
            Author();
            break;
        case 5:
            Titlelist();
            break;
        case 6:
            Stock();
            break;
        case 7:
            Issue();
            break;
        case 8:
            bookret();
            break;
        case 9:
            Addmembr();
            break;
        case 10:
            Exit();
        default:
            printf(" ! Invalid Input...\n");
    }
}while(choice!=10);
 return (0);
}
//字数超出范围,请查看附件


回答2:

出多少人民币