資源簡介
針對小型書店的日常進銷存業務特點及其經營的靈活性而開發; 2. 主要功能包括:進書、銷售、盤點、庫存不足提示、財務統計、查詢等; 3. 查詢包括:進書查詢與管理、存書查詢,銷售查詢,庫存不足查詢; 4. 財務統計可能包括:當日銷售額統計、當月銷售額統計、圖書銷售額排名、圖書分類銷售排名、 5.

代碼片段和文件信息
/*小型書店進銷存管理系統
基本功能
1.?針對小型書店的日常進銷業務特點以及其經營的靈活性而開發。
2.?主要功能包括:進書,銷售,盤點。內存不足提示,財務統計。
3.?查詢包括:進書查詢與管理,存書查詢,銷售查詢,庫存不足查詢。
4.?財務統計可能包括:當日銷售額統計,當月銷售額統計,圖書銷售名,圖書分類銷售排名。
5.?圖書銷售支持折扣優惠促銷活動。
6.?系統界面清爽,操作簡便。
7.?具有獨特的功能。*/
#include
#include
#include
#include
float?profit=0total=0;
//定義結構體
struct?books_list
{
???
???char?author[20];???????
???char?bookname[20];????????????
???int?num1;??????????
???int?num2;??????????????
???float??price1;?????????????????
???float??price2;?????????????
???struct?books_list?*?next;??
};
??????
struct?books_list?*?Create_Books_Doc();?????
void?InsertDoc(struct?books_list?*?head);?
void?DeleteDoc(struct?books_list?*?head??int?num);
void?liulan(struct?books_list?*?head);
void?search_book(struct?books_list?*?head);
void?sale(struct?books_list?*?head);
void?save(struct?books_list?*?head);
void?tongji();
void?xiugai(struct?books_list?*?head);
void?jinggao(struct?books_list?*?head);
void?paihang(struct?books_list?*?head);
//創建鏈表
struct?books_list?*?Create_Books_Doc()
{
?struct?books_list?*?head;
?head=(struct?books_list?*)malloc(sizeof(struct?books_list));
?head->next=NULL;??
?return?head;
}
//保存
void?save(struct?books_list?*?head)
{
?struct?books_list?*p;
?FILE?*fp;
?p=head;
?fp=fopen(“data.txt““w+“);
?while(p->next)
?{
??p=p->next;
??fprintf(fp“%s?%s?%d?%d?%f?%f\n“p->booknamep->authorp->num1p->num2p->price1p->price2);
?}
?fclose(fp);
?printf(“???????????????????已將圖書數據保存到?data.txt?文件\n“);
}
//進書
void?InsertDoc(struct?books_list?*head)
{
?struct?books_list?*s?*p*q;
?char?flag=‘Y‘;
?int?f;
?while(flag==‘Y‘||flag==‘y‘)
?{
?p=head;
?while(p->next)
?{
??p=p->next;
?}???
??s=(struct?books_list?*)malloc(sizeof(struct?books_list));
??fflush(stdin);
??s->num1=0;
??printf(“\n????????????????????請輸入圖書書名:“);
??fflush(stdin);
??scanf(“%s“s->bookname);
??q=head;
??while(q!=NULL)
??{
??if(strcmp(s->booknameq->bookname)==0)
??{
??printf(“\n????????????????????請輸入進書數量:“);
??????????fflush(stdin);
??????????scanf(“%d“&f);
??q->num2+=f;
??goto?app;
??}
??q=q->next;
??}
??printf(“\n????????????????????請輸入圖書作者名:“);
??fflush(stdin);
??scanf(“%s“s->author);
??printf(“\n????????????????????請輸入進書數量:“);
??fflush(stdin);
??scanf(“%d“&s->num2);
??printf(“\n????????????????????請輸入圖書進價:“);
??fflush(stdin);
??scanf(“%f“&s->price1);
??printf(“\n????????????????????請輸入圖書售價:“);
??fflush(stdin);
??scanf(“%f“&s->price2);
??printf(“\n“);
??p->next=s;??
????????p=s;?
??s->next=NULL;
app:printf(“???????????????????━━━━?進書成功!━━━━“);
??printf(“\n???????????????????????????繼續進書?(Y/N):“);
??fflush(stdin);
??scanf(“%c“&flag);
??printf(“\n“);
?}
?save(head);??
?return;
}
//查找
void?search_book(struct?books_list?*head)
{
?struct?books_list?*?p;
?char?temp[20];
?p=head;
?if(head==NULL?||?head->next==NULL)
?{
??printf(“??????????????????????━━━━?圖書庫為空!━━━━\n“);
?}
?else
?{
??printf(“
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????120??2011-12-11?10:20??大作業(提交)\data.txt
?????文件????????124??2011-12-08?09:53??大作業(提交)\Debug\data.txt
?????文件??????41984??2011-12-11?10:21??大作業(提交)\Debug\vc60.idb
?????文件??????53248??2011-12-11?10:21??大作業(提交)\Debug\vc60.pdb
?????文件??????40899??2011-12-11?10:21??大作業(提交)\Debug\大作業.obj
?????文件?????217183??2011-12-11?10:21??大作業(提交)\Debug\大作業(2次修改).exe
?????文件?????309628??2011-12-11?10:21??大作業(提交)\Debug\大作業(2次修改).ilk
????I.A....????235616??2011-12-11?09:42??大作業(提交)\Debug\大作業(2次修改).pch
?????文件?????533504??2011-12-11?10:21??大作業(提交)\Debug\大作業(2次修改).pdb
?????文件??????14519??2011-12-11?10:22??大作業(提交)\大作業.cpp
?????文件???????4407??2011-12-07?20:02??大作業(提交)\大作業(2次修改).dsp
?????文件????????542??2011-12-07?18:34??大作業(提交)\大作業(2次修改).dsw
?????文件??????50176??2011-12-11?10:22??大作業(提交)\大作業(2次修改).ncb
?????文件??????48640??2011-12-11?10:22??大作業(提交)\大作業(2次修改).opt
?????文件???????1361??2011-12-11?10:21??大作業(提交)\大作業(2次修改).plg
?????目錄??????????0??2011-12-11?10:21??大作業(提交)\Debug
?????目錄??????????0??2011-12-11?10:22??大作業(提交)
-----------?---------??----------?-----??----
??????????????1551951????????????????????17
- 上一篇:C語言練習題+綜合模擬卷3套(附答案)
- 下一篇:pesq MOS 語音評測代碼
評論
共有 條評論