From 0eb32a5f6eefc5908921ad9e67947f7d10c515cd Mon Sep 17 00:00:00 2001 From: Your Name <2664233913@qq.com> Date: Thu, 10 Jan 2019 16:19:43 +0800 Subject: [PATCH] third commit --- 未命名3.cpp | 467 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 467 insertions(+) create mode 100644 未命名3.cpp diff --git a/未命名3.cpp b/未命名3.cpp new file mode 100644 index 0000000..b8d2820 --- /dev/null +++ b/未命名3.cpp @@ -0,0 +1,467 @@ +#include +#include +#include +#include +#define N 1000 /*洢1000豸豸Ϣ*/ +int flag; /*Ƿ¼*/ +struct date /**/ +{ + int year; + int month; + int day; +}; +struct machine +{ + char num[20];/**/ + char name[25];/**/ + char kind[10];/**/ + char price[10];/*۸*/ + char way[10];/*취*/ + char lost[10];/*ķ*/ + struct date birthday;/**/ + char yesno[10];/*Ƿ񱨷YN*/ + struct date time;/*ʱ*/ +}stu[N]; + +void printf_one(int k) /*һ豸Ϣ*/ +{ + system("color 4e"); + printf("ţ%s\n",stu[k].num); + printf("ƣ%s\n",stu[k].name); + printf("ࣺ%s\n",stu[k].kind); + printf("۸%s\n",stu[k].price); + printf("£%d/%d/%d\n",stu[k].birthday.year,stu[k].birthday.month,stu[k].birthday.day); + printf("Ƿ񱨷ϣ%s\n",stu[k].yesno); + printf("ʱ䣺%d/%d/%d\n",stu[k].time.year,stu[k].time.month,stu[k].time.day); + printf("취%s\n",stu[k].way); + printf("ķã%s\n",stu[k].lost); +} + +void printf_n(int n) /*ʱ豸Ϣ*/ +{ + system("color 2e"); + int j,i=1; + for(j=0;j2) + { + printf("!!\n"); + w2=1; + } + else + w2=0; /*Ҫע⣺仰ѭ*/ + }while(w2==1); + if(w1==1) /*Ʋ*/ + { + do + { + k=-1; + do + { + printf("\nҪҵ豸!\nName:"); + scanf("%s",s.name); + for(i=0;i12||c<1) + { + puts("\nѡ!ѡ!"); + getchar(); + } + }while(c>12||c<1); + do + { + switch(c) + { + case 1: printf(":"); scanf("%s",stu[i].num); break; + case 2: printf(":"); scanf("%s",stu[i].name); break; + case 3: printf(":"); scanf("%s",stu[i].kind);break; + case 4: printf("۸:"); scanf("%s",stu[i].price); break; + case 5: printf(":"); scanf("%d/%d/%d",&stu[i].birthday.year,&stu[i].birthday.month,&stu[i].birthday.day); break; + case 6: printf("Ƿ񱨷:"); scanf("%s",stu[i].yesno);break; + case 7: printf("ʱ:"); scanf("%d/%d/%d",&stu[i].time.year,&stu[i].time.month,&stu[i].time.day);break; + case 8: printf("ʽ:"); scanf("%s",stu[i].way); break; + case 9: printf(":"); scanf("%s",stu[i].lost); break; + case 10: input(i); break; /*޸豸Ϣ*/ + case 11: menu(); /*˵*/ + } + puts("\nNow:\n"); + printf_one(i); /* ޸ĺ 豸Ϣ*/ + printf("\nȷ?\n\n\t1). 2).޸ 3).ز [ ]\b\b"); + scanf("%d",&w1); + }while(w1==2); + return(w1); /*޸ijɹѡ1󷵻1*/ +} + +void modify() /*޸*/ +{ + void menu(); + { + struct machine s; + int i,n,k,w0=1,w1,w2=0; + n=load(); + do + { + k=-1; + //printf_n(n); /*ɾ֮ǰʾ豸Ϣ*/ + do + { + printf("\nҪ޸ĵ豸!\nName:"); + scanf("%s",s.name); + for(i=0;i7) + { + system("cls"); + printf("ѡ! ѡ!\n"); + w1=1; + } + else + w1=0; + }while(w1==1); + switch(n) + { + case 1: system("cls"); insert(); break; /**/ + case 2: system("cls"); deleter(); break; /*ɾ*/ + case 3: system("cls"); search(); break; /**/ + case 4: system("cls"); modify(); break; /*޸*/ + case 5: system("cls"); browse(); break; /**/ + case 7: exit(); break; /*˳*/ + } +} + +int main() +{ + menu(); + return 0; +}