資源簡(jiǎn)介
我大一做的系統(tǒng),能完整實(shí)現(xiàn)圖書(shū)館的基本功能:借書(shū)、還書(shū)、查詢(xún)、刪除、修改等。
代碼片段和文件信息
#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);/*瀏覽所有圖書(shū)信息*/??
void?Print_Student(struct?student*head_student);/*瀏覽所有學(xué)生信息*/??
struct?book?*Create_New_Book();/*創(chuàng)建新的圖書(shū)庫(kù),圖書(shū)編號(hào)輸入為0時(shí)結(jié)束*/??
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);/*增加圖書(shū),逐個(gè)添加*/??
struct?book?*Delete_Book(struct?book?*head_bookint?ID);/*刪除圖書(shū)*/??
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〓〓〓〓〓圖書(shū)管理系統(tǒng)〓〓〓〓〓\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]:學(xué)生\t“);
printf(“\n\n\n“);
printf(“\t\t\t[0]:退出\n\n“);?
printf(“\n\n\n“);
printf(“第一次進(jìn)入圖書(shū)管理系統(tǒng)請(qǐng)先選1!!!\n\n“);
printf(“請(qǐng)選擇<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.新增書(shū)庫(kù)和學(xué)生庫(kù)\n\n“);
printf(“2.增加圖書(shū)\n\n“);???
printf(“3.刪除圖書(shū)\n\n“);?
printf(“4.查看所有學(xué)生信息\n\n“);
printf(“5.查找學(xué)生\n\n“);
printf(“6.增加學(xué)生\n\n“);
printf(“0.返回主菜單\n\n“);
printf(“第一次進(jìn)入圖書(shū)管理系統(tǒng)請(qǐng)先選1!!!\n\n“);
printf(“請(qǐng)選擇:\n\n“);?
scanf(“%d“&h);
system(“cls“);?
if?(h==1)
{
printf(“\n歡迎您第一次進(jìn)入圖書(shū)管理系統(tǒng)!\n\n“);???
printf(“----->[向?qū)----->[新建圖書(shū)庫(kù)]\n\n“);???
printf(“注意:當(dāng)輸入圖書(shū)編號(hào)為0時(shí)進(jìn)入下一步.\n\n“);???
head_book=Create_New_Book();???
printf(“\n歡迎您第一次進(jìn)入圖書(shū)管理系統(tǒng)!\n\n“);???
printf(“----->[向?qū)----->[新建學(xué)生庫(kù)]\n\n“);???
printf(“注意:當(dāng)輸入學(xué)生學(xué)號(hào)為0時(shí)進(jìn)入主菜單.\n\n“);???
head_student=Creat
評(píng)論
共有 條評(píng)論