資源簡介
我大一做的系統,能完整實現圖書館的基本功能:借書、還書、查詢、刪除、修改等。
代碼片段和文件信息
#include???
#include???
#include???
struct?book
{???
????char?book_name[30];???
????int?ID;???
????double?price;???
????char?author[20];???
????char?state[20];???
????char?name[20];???
????char?sex[10];???
????int?studnum;??
????struct?book?*book_next;???
};???
struct?student
{???
????char?name[20];???
????char?sex[10];???
????int?studnum;???
????char?borrow[30];???
????struct?student?*student_next;?
};?
void?Print_Book(struct?book?*head_book);/*瀏覽所有圖書信息*/??
void?Print_Student(struct?student*head_student);/*瀏覽所有學生信息*/??
struct?book?*Create_New_Book();/*創建新的圖書庫,圖書編號輸入為0時結束*/??
struct?book?*Search_Book_ID(int?IDstruct?book?*head_book);???
struct?book?*Search_Book_name(char?*b_namestruct?book?*head_book);???
struct?book?*Insert_Book(struct?book?*head_bookstruct?book?*stud_book);/*增加圖書,逐個添加*/??
struct?book?*Delete_Book(struct?book?*head_bookint?ID);/*刪除圖書*/??
struct?student?*Create_New_Student();???
struct?student?*Search_Student_studnum(int?studnumstruct?student?*head_student);???
struct?student?*Search_Student_name(char?*s_namestruct?student?*head_student);???
struct?student?*Insert_Student(struct?student?*head_studentstruct?student?*stud_club);???
struct?student?*Delete_Student(struct?student?*head_studentint?studnum);?
struct?book?*Lent_Book(int?IDint?studnumstruct?book?*head_bookstruct?student?*head_student);???
struct?book?*back(int?IDint?studnumstruct?book?*head_bookstruct?student?*head_student);?
int?main()???
{???
????struct?book?*head_book*p_book;???
????char?book_name[30]name[20]author[20]sex[10];???
????int?ID;???
????double?priceprice_hprice_l;???
????int?size_book=sizeof(struct?book);???
????int?m=1n=1fhoxy;???
????char?*b_name*s_name;???
????struct?student?*head_student*p_student;???
????int?studnum;???
????int?size_student=sizeof(struct?student);???
int?choice;
loop:
printf(“\n\t\t\t〓〓〓〓〓圖書管理系統〓〓〓〓〓\n\n“);???
printf(“\n“);???
printf(“please?choice?your?position?:\n“);
printf(“\t\t\t[1]:管理員\t“);
printf(“\n\n\n“);
printf(“\t\t\t[2]:學生\t“);
printf(“\n\n\n“);
printf(“\t\t\t[0]:退出\n\n“);?
printf(“\n\n\n“);
printf(“第一次進入圖書管理系統請先選1!!!\n\n“);
printf(“請選擇<0--2>:\n“);
scanf(“%d“&choice);
printf(“\n\t\t\t〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓\n\n\n\n“);?
while(choice!=0)
{
switch(choice)
{
loopg: case?1:
printf(“1.新增書庫和學生庫\n\n“);
printf(“2.增加圖書\n\n“);???
printf(“3.刪除圖書\n\n“);?
printf(“4.查看所有學生信息\n\n“);
printf(“5.查找學生\n\n“);
printf(“6.增加學生\n\n“);
printf(“0.返回主菜單\n\n“);
printf(“第一次進入圖書管理系統請先選1!!!\n\n“);
printf(“請選擇:\n\n“);?
scanf(“%d“&h);
system(“cls“);?
if?(h==1)
{
printf(“\n歡迎您第一次進入圖書管理系統!\n\n“);???
printf(“----->[向導]----->[新建圖書庫]\n\n“);???
printf(“注意:當輸入圖書編號為0時進入下一步.\n\n“);???
head_book=Create_New_Book();???
printf(“\n歡迎您第一次進入圖書管理系統!\n\n“);???
printf(“----->[向導]----->[新建學生庫]\n\n“);???
printf(“注意:當輸入學生學號為0時進入主菜單.\n\n“);???
head_student=Creat
- 上一篇:語義分析實驗報告和代碼
- 下一篇:wanlix mindows操作系統源碼
評論
共有 條評論