Current location - Training Enrollment Network - Books and materials - C language program translation needs expert sentence-by-sentence translation.
C language program translation needs expert sentence-by-sentence translation.
//This section is used to contain the required header files, you know.

# include & ltstdio.h & gt

# include & ltstdlib.h & gt

# include & ltstring.h & gt

//This section declares a structure called book, which is used to store the book information of a book.

Structure book (

//Book name

char book _ name[30];

//The number of the book

Int edge number;

//The price of books

Double the price;

//The author of this book

Char author [20];

//Inventory status of current books

State of charge [20];

//This book was lent to a man named name.

char name[20];

//Are these books for men or women?

char sex[ 10];

//Books are lent to students with student numbers.

Int xuehao;

//This field is a pointer to the book structure, indicating that the author wants to use the linked list to store or manipulate all the book information.

struct book * book _ next

};

//Personal information of the borrower (similar to this)

Structural club {

char name[20];

char sex[ 10];

Int xuehao;

//The title of the book borrowed

Char borrow [30];

//Linked list pointer

struct club * club _ next

};

void Print _ Book(struct Book * head _ Book); /* Browse all book information */

Void Print_Club (structural club * head club); /* Browse all member information */

struct Book * Create _ New _ Book(); /* Create a new library, and it will end when the ISBN is 0 */

//Find the book information according to the given book number.

struct Book * Search _ Book _ bian Hao(int bian Hao,struct Book * head _ Book);

//Find the book information according to the given book name.

struct Book * Search _ Book _ name(char * b _ name,struct Book * head _ Book);

//Find the book information according to the given book price.

struct Book * Search _ Book _ price(double price _ h,double price_l,struct Book * head _ Book);

//Insert a new node in the linked list.

struct Book * Insert _ Book(struct Book * head _ Book,struct Book * stud _ Book); /* Add books one by one */

//Delete a node in the linked list.

struct Book * Delete _ Book(struct Book * head _ Book,int bianhao); /* Delete books */

//Create a new borrower information structure

struct Club * Create _ New _ Club();

//Find the borrower's information according to the given student number.

struct Club * Search _ Club _ xuehao(int xuehao,struct Club * head _ Club);

//Find the borrower information according to the given borrower name.

Structural club * search _ club _ name (char * c _ name, structural club * head _ club);

//Insert a new node in the borrower information linked list.

struct Club * Insert _ Club(struct Club * head _ Club,struct Club * stud _ Club);

//Delete the node in the borrower information linked list.

Struct club * delete _ club (struct club * head _ club, int student number);

//Borrow a book

struct Book * Lent _ Book(int bian Hao,int xuehao,struct book *head_book,struct club * head _ club);

//Return the book

struct book *back(int bianhao,int xuehao,struct book *head_book,struct club * head _ club);

//Console program entry point function

int main()

{

//Next, there are many variables to create.

Structure book * head _ book, * p _ book;

Char book_name[30], name [20], author [20], gender [10];

Int edge number;

Double price, price_h, price _ l;;

int size _ book = sizeof(struct book);

int m= 1,n= 1,f;

char *b_name,* c _ name

Structure club *head_club, * p _ club

Int xuehao;

int size _ club = sizeof(struct club);

All hands-on, hoping to help the landlord.