From 7d57c5bc1b51a8e4311dd976eeea98d508bf2801 Mon Sep 17 00:00:00 2001 From: agony Date: Tue, 8 Jan 2019 13:53:43 +0800 Subject: [PATCH] first commit --- 销售管理系统.c | 295 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 295 insertions(+) create mode 100644 销售管理系统.c diff --git a/销售管理系统.c b/销售管理系统.c new file mode 100644 index 0000000..2c3cd1a --- /dev/null +++ b/销售管理系统.c @@ -0,0 +1,295 @@ +#include +#include +#include +#include +#define MAX_NOTE 150//150 +FILE *fp; +typedef struct +{ + int sno;//Ա + int p1;//Ʒ1 + int p2;//Ʒ2 + int p3;//Ʒ3 + int p4;//Ʒ4 + int p5;//Ʒ5 +}SELL; +SELL s[MAX_NOTE]; +void add_note(); +void menu(); +void visit_sale(); +void sale_sort(); +void sale_data(); +void pro_sort(); +void clear_all(); +int main() +{ + menu(); + return 0; +} +void menu()//˵ +{ + system("cls"); + system("color 0B"); + int choice; + printf("\n\n\n\n\t\t\t\t"); + printf("-*-*-*-*ӭ۹ϵͳ-*-*-*-*-\n"); + printf("\t\t\t\t|1.Ϣ¼\n"); + printf("\t\t\t\t|2.鿴\n"); + printf("\t\t\t\t|3.\n"); + printf("\t\t\t\t|4.˳ϵͳ\n"); + printf("\n\n\n\n\t\t\t\tѡ1-3"); + scanf("%d",&choice); + switch(choice) + { + case 1: + add_note();//¼ + break; + case 2: + visit_sale();//˵ + break; + case 3: + clear_all();// + break; + case 4: + exit(0); + break; + default: + printf("룺"); + break; + } + menu(); + getchar(); +} +void clear_all() +{ + system("cls"); + fp=fopen("note.dat","wb+"); + fclose(fp); + printf("\n\n\n\n\t\t\t\tɹ"); + system("pause"); + menu(); +} +void add_note()//Ϣ¼ +{ + system("cls"); + int i,n,k=1; + //SELL s[MAX_NOTE]; + fp=fopen("note.dat","rb+"); + if(fp==NULL) + { + fp=fopen("note.dat","wb+"); + if(fp==NULL) + { + printf("file open fail!\n"); + exit(0); + } + } + fseek(fp,0,SEEK_END); + printf("\n\n\n\n\t\t\t\tҪӵı"); + scanf("%d",&n); + for(i=0;i