C語言圖書管理系統課設
專案說明
本系統基於C語言開發,適用於剛入門的C語言新手專案課設,開發軟體採用VC++6.0開發,VS,DEV C++等均可執行。
專案執行截圖
程式碼介面截圖
部分關鍵程式碼:
int search_history(char no[],char issn[],struct History **history_p1,struct History **history_p2)//p1為前一個指標,p2是待查項指標
{
int flag=0;//標記找沒找到,初始值0
*history_p1=*history_p2=history_head;
if(strcmp(issn,"ALL")==0)
{
while(*history_p2!=NULL)
{
if((strcmp(no,(*history_p2)->no)==0))
{
flag=1;
printf("學號:%s issn編號:%s\n借書日期:%d/%d/%d\n還書日期:%d/%d/%d\n違約金:%lf\n",
(*history_p2)->no,(*history_p2)->issn,
(*history_p2)->borrow_date.year,(*history_p2)->borrow_date.month,(*history_p2)->borrow_date.day,
(*history_p2)->return_date.year,(*history_p2)->return_date.month,(*history_p2)->return_date.day,
(*history_p2)->penalty);
puts("**********************");
}
*history_p1=*history_p2;
*history_p2=(*history_p1)->next;
}
puts("**********************");
system("pause");
}
else
{
while(*history_p2!=NULL)
{
if(strcmp(no,(*history_p2)->no)==0&&strcmp(issn,(*history_p2)->issn)==0&&(*history_p2)->return_date.year==0)//學號找到,書號找到,且沒有還書
{
flag=1;
break;//找到,跳出
}
*history_p1=*history_p2;
*history_p2=(*history_p1)->next;
}
if(flag)//找到了
{
puts("找到此記錄");
printf("學號:%s issn編號:%s\n借書日期:%d/%d/%d\n還書日期:%d/%d/%d\n違約金:%lf\n",
(*history_p2)->no,(*history_p2)->issn,
(*history_p2)->borrow_date.year,(*history_p2)->borrow_date.month,(*history_p2)->borrow_date.day,
(*history_p2)->return_date.year,(*history_p2)->return_date.month,(*history_p2)->return_date.day,
(*history_p2)->penalty);
}
else
puts("無此記錄!!!");
system("pause");
}
return flag;
}
獲取完整原始碼:
https://max.book118.com/html/2020/1010/8046003011003005.shtm