From f70aa21cf08bcf64d797c5359f99fdc6f648d21e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 8 Jan 2019 14:30:51 +0800 Subject: [PATCH] third commit --- 图书管理系统正式版.cpp | 1843 +++++++++++++++++++++++++++++++ 1 file changed, 1843 insertions(+) create mode 100644 图书管理系统正式版.cpp diff --git a/图书管理系统正式版.cpp b/图书管理系统正式版.cpp new file mode 100644 index 0000000..8830883 --- /dev/null +++ b/图书管理系统正式版.cpp @@ -0,0 +1,1843 @@ +#include +#include +#include +#include +#include +#include +#include + +#define BACKSPACE 8 +#define PASS_MAXLEN 128 +#define LEN sizeof(struct Book) +#define LEN1 sizeof(struct reader) + +void home();//עҳ +void Reg();//ע +void Log();//¼ +void Adm();//Ա +int UserMenu();//ûҳ +int AdminMenu();//Աҳ +void BroBook();// +void BacBook();// +void LooBook(int n);//ѯ鼮 +void AddBook();//鼮 +void DelBook();//ɾ鼮 +void FixBook();//޸鼮 +int Total();//ͳ +int Total1();//ͳ˻->޸ûظ +int Total2();//ͳƶ +void SBAut(int q);//ͼ߲ѯ +void SBNam(int q);//ͼֲѯ +void SBCat(int q);//ͼѯ +void ed();// +void Reader();//߽Ϣ +void Readername();//ֲҽ +void Allreader();//в鿴 + +////עҳ +int main(){ + home(); +} + +//鼮Ľṹ + +struct Book//ͼϢ +{ + char num[20],nam[20],aut[20],pub[20],cat[20]; + int many; + float price; + struct Book *next; +}; +struct reader//Ϣ +{ + int xuehao; + char username[20],time[20],name[20]; + struct reader *next; +}; + +void ed(void) +{ + system("cls"); + printf("******************************************************************************************\n"); + printf("* ͼϵͳVersion 1.0 *\n"); + printf("******************************************************************************************\n"); + printf("* *\n"); + printf("* *\n"); + printf("* ݰݿd(ء`)o *\n"); + printf("* *\n"); + printf("* *\n"); + printf("******************************************************************************************\n"); + Sleep(1000); + system("cls"); + home(); +} +//ҳ +void home(){ + system("cls"); +while(1){ + char c; + printf("******************************************************************************************\n"); + printf("* ͼϵͳVersion 1.0 *\n"); + printf("******************************************************************************************\n"); + printf("* *\n"); + printf("* ѽӭʹͼϵͳ *\n"); + printf("* *\n"); + printf("* ʲôأ *\n"); + printf("* *\n"); + printf("* 鷳ֱʾҪִеIJ *\n"); + printf("* *\n"); + printf("* *\n"); + printf("******************************************************************************************\n"); + printf("*ͨû𣿣 * ҵMaster𣿣 *\n"); + printf("* * *\n"); + printf("* 1.עû,ǩԼo(**) * 3.Master½ (*/*) *\n"); + printf("* 2.Լǩˣֱӵ½ * *\n"); + printf("* * *\n"); + printf("******************************************************************************************\n\n\n"); + printf("\t\t\t\t\t\t\t\t\tִеIJ"); + c=getch(); + if(c=='1'){ + Reg(); + break; + }else if(c=='2'){ + Log(); + break; + }else if (c=='3'){ + Adm(); + } + system("cls"); +} + +} +//ע +void Reg(){ + FILE *fp=fopen("˺Ź.txt","r"); + fp=fopen("˺Ź.txt","r"); + system("cls"); + int k=0; + char t; + int i=0; + char c; + char UserName[50],PassWord[10],RePassWord[10]; + char name[100],password[100]; + printf("\n\n\t\t\t\t\tǩԼ\n\n\n"); + printf(" ȡְɦ(bb*)/,ֻӢ,»,ŶESCص½棩\n\n "); + while(1){ + c=getch(); + if(c==27) home(); + if(c=='\r'||c=='\n'){ + UserName[i]=0; + break; + } + else if(c==8) + { + if(i==0) i=0; + else + { + printf("\b \b"); + i=i-1; + } + }else if((c<='Z'&&c>='A')||(c<='z'&&c>='a')||(c<='9'&&c>='0')){ + UserName[i++]=c; + putchar(c); + } + } + printf("\n\n 룬Ҫй¶ѼСBBs 3t \n\n "); + while(1){ + int i=0; + char c; + while(1){ + c=getch(); + if(c==27) home(); + if(c=='\n'||c=='\r'){ + PassWord[i]=0; + break; + } + else if(c==BACKSPACE){ + PassWord[--i]='\0'; + putchar(BACKSPACE); + putchar(' '); + putchar(BACKSPACE); + }//DELETE + else{ + PassWord[i++]=c; + putchar('*'); + } + } + i=0; + printf("\n\n ȷһQAQ\n\n "); + while(1){ + c=getch(); + if(c==27) home(); + if(c=='\n'||c=='\r'){ + RePassWord[i]=0; + break; + } + else if(c==8) + { + if(i==0) i=0; + else + { + printf("\b \b"); + i=i-1; + } + } + else{ + RePassWord[i++]=c; + putchar('*'); + } + } + system("cls"); + printf("\n\n\n"); + printf("\t\t\t\n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t ע. \n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t\n"); + Sleep(500); + system("cls"); + printf("\n\n\n"); + printf("\t\t\t\n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t ע.. \n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t\n"); + Sleep(500); + system("cls"); + printf("\n\n\n"); + printf("\t\t\t\n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t ע... \n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t\n"); + Sleep(500); + system("cls"); + printf("\n\n\n"); + printf("\t\t\t\n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t ע. \n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t\n"); + Sleep(500); + system("cls"); + printf("\n\n\n"); + printf("\t\t\t\n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t ע.. \n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t\n"); + Sleep(500); + system("cls"); + int j=Total1();//һjû,Totalͳıжٸû + for(int i=0;i='A')||(c<='z'&&c>='a')||(c<='9'&&c>='0')){ + UserName[i++]=c; + putchar(c); + } + } + printf("\n\n :\n\n "); + i=0; + while(1){ + c=getch(); + if(c==27) home(); + if(c=='\r'||c=='\n'){ + PassWord[i]=0; + break; + } + else if(c==8) + { + if(i==0) i=0; + else + { + printf("\b \b"); + i=i-1; + } + } + else if((c<='Z'&&c>='A')||(c<='z'&&c>='a')||(c<='9'&&c>='0')){ + PassWord[i++]=c; + putchar('*'); + } + } + int j=Total1(); + system("cls"); + printf("\n\n\n"); + printf("\t\t\t\n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t ½. \n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t\n"); + Sleep(500); + system("cls"); + printf("\n\n\n"); + printf("\t\t\t\n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t ½.. \n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t\n"); + Sleep(500); + system("cls"); + printf("\n\n\n"); + printf("\t\t\t\n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t ½... \n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t\n"); + Sleep(500); + system("cls"); + printf("\n\n\n"); + printf("\t\t\t\n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t ½. \n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t\n"); + Sleep(500); + system("cls"); + printf("\n\n\n"); + printf("\t\t\t\n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t ½.. \n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t\n"); + Sleep(500); + system("cls"); + for(int f=0;f='A')||(c<='z'&&c>='a')||(c<='9'&&c>='0')){ + AdminName[i++]=c; + putchar(c); + } + } + printf("\n\n :\n\n "); + i=0; + while(1){ + c=getch(); + if(c==27) home(); + if(c=='\r'||c=='\n'){ + PassWord[i]=0; + break; + } + else if(c==8) + { + if(i==0) i=0; + else + { + printf("\b \b"); + i=i-1; + } + } + else if((c<='Z'&&c>='A')||(c<='z'&&c>='a')||(c<='9'&&c>='0')){ + PassWord[i++]=c; + putchar('*'); + } + } + int j=1; + system("cls"); + printf("\n\n\n"); + printf("\t\t\t\n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t ½. \n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t\n"); + Sleep(500); + system("cls"); + printf("\n\n\n"); + printf("\t\t\t\n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t ½.. \n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t\n"); + Sleep(500); + system("cls"); + printf("\n\n\n"); + printf("\t\t\t\n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t ½... \n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t\n"); + Sleep(500); + system("cls"); + printf("\n\n\n"); + printf("\t\t\t\n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t ½. \n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t\n"); + Sleep(500); + system("cls"); + printf("\n\n\n"); + printf("\t\t\t\n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t ½.. \n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t\n"); + Sleep(500); + system("cls"); + for(int f=0;fnext=p1; + p2=p1; + p1=(struct Book*)malloc(LEN); + } + strcpy(p1->num,Num);// + strcpy(p1->nam,Nam);// + strcpy(p1->aut,Aut);// + strcpy(p1->pub,Pub);//Ƴ + strcpy(p1->cat,Cat);// + p1->many=Many;//Ƹ + p1->price=Price;//Ƶ + } + if(n==0){ + head=NULL; + } + else{ + p2->next=p1; + p1->next=NULL; + fclose(fp); + } + } + p=head; + for(;p!=NULL;){ + if(!strcmp(p->nam,ReName)){ + flag=1; + k=p->many; + (p->many)--; + } + p=p->next; + } + if((k>0)&&flag){ + + fp=fopen("ͼ.txt","w"); + fclose(fp); + fp=fopen("ͼ.txt","a"); + p=head; + for(;p!=NULL;){ + fprintf(fp,"%-8s%-8s%-16s%-16s%-16s%-10d%10.2f\n",p->num,p->nam,p->aut,p->pub,p->cat,p->many,p->price); + p=p->next; + } + free(p); + fclose(fp); + if((fp1=fopen(".txt","r"))==NULL){ + fp1=fopen(".txt","w"); + fclose(fp1); + } + fp1=fopen(".txt","a"); + printf("ѧţ"); + scanf("%d",&Xuehao); + printf("֣"); + scanf("%s",Mingzi); + printf("(/·/)"); + scanf("%s",Riqi); + printf(""); + scanf("%s",Shuming); + fprintf(fp1,"%-8d%-23s%-18s%-10s\n",Xuehao,Mingzi,Riqi,Shuming); + fclose(fp1); + printf("ɹ,밴ʱ黹,Esc˳\n"); + t=getch(); + while(t!=27){ + t=getch(); + continue; + } + if(t==27){ + UserMenu(); + } + } + else{ + if(flag!=0){ + printf("ûҪ鼮,Esc\n");// + + + + + + while(t!=27){ + t=getch(); + continue; + } + UserMenu(); + }else{ + printf("治㣬Esc\n"); + } + } + while(t!=27){ + t=getch(); + continue; + } + UserMenu(); +} + +// +void BacBook(){ + system("cls"); + struct reader *head=NULL; + struct Book *zhead=NULL; + struct Book *zp,*zp1,*zp2; + struct reader *p,*p1,*p2; + FILE *fp,*fp1; + float Price=0; + char t,ReName[100]; + int Many; + int n=0,j=0,k=0,flag=0,l=0;//kǿ; + char Num[20]={'\0'},Aut[20]={'\0'},Pub[20]={'\0'},Nam[20]={'\0'},Cat[20]={'\0'}; + int Xuehao,ReXuehao; + char Mingzi[20]={'\0'},Riqi[20]={'\0'},Shuming[20]={'\0'}; + fp=fopen(".txt","r"); + if(fp==NULL){ + system("cls"); + printf("δڶļϵԱ\n"); + printf("Esc\n"); + t=getch(); + while(t!=27){ + t=getch(); + continue; + } + UserMenu(); + }else{ + printf("ѧţ");// + scanf("%d",&ReXuehao); + printf(""); + scanf("%s",ReName); + j=Total2(); + for(int i=0;inext=p1; + p2=p1; + p1=(struct reader*)malloc(LEN1); + } + p1->xuehao=Xuehao; + strcpy(p1->username,Mingzi); + strcpy(p1->time,Riqi); + strcpy(p1->name,Shuming); + } + if(n==0){ + head=NULL; + }else{ + p2->next=p1; + p1->next=NULL; + fclose(fp); + } + fp=fopen(".txt","w"); + fclose(fp); + fp=fopen(".txt","a"); + p=head; + for(;p!=NULL;){ + fprintf(fp,"%-8d%-23s%-18s%-10s\n",p->xuehao,p->username,p->time,p->name); + p=p->next; + } + free(p); + fclose(fp); + if(flag){ + printf("Ƿȷϻ飬밴س,˳밴Esc\n"); + t=getch(); + while(t!=13&&t!=27){ + t=getch(); + continue; + } + if(t==27){ + printf("ת..."); + Sleep(1000); + UserMenu(); + } + printf("ɹEsc"); + n=0,flag=0; + l=Total(); + fp1=fopen("ͼ.txt","r"); + for(int i=0;inext=zp1; + zp2=zp1; + zp1=(struct Book*)malloc(LEN); + } + strcpy(zp1->num,Num);// + strcpy(zp1->nam,Nam);// + strcpy(zp1->aut,Aut);// + strcpy(zp1->pub,Pub);//Ƴ + strcpy(zp1->cat,Cat);// + zp1->many=Many;//Ƹ + zp1->price=Price;//Ƶ + } + if(n==0){ + zhead=NULL; + } + else{ + zp2->next=zp1; + zp1->next=NULL; + fclose(fp1); + } + } + zp=zhead; + for(;zp!=NULL;){ + if(!strcmp(zp->nam,ReName)){ + k=zp->many; + (zp->many)++; + } + zp=zp->next; + } + fp1=fopen("ͼ.txt","w"); + fclose(fp1); + fp1=fopen("ͼ.txt","a"); + zp=zhead; + for(;zp!=NULL;){ + fprintf(fp1,"%-8s%-8s%-16s%-16s%-16s%-10d%10.2f\n",zp->num,zp->nam,zp->aut,zp->pub,zp->cat,zp->many,zp->price); + zp=zp->next; + } + fclose(fp1); + t=getch(); + while(t!=27){ + t=getch(); + continue; + } + if(t==27){ + UserMenu(); + } + else{ + system("cls"); + printf(",Esc\n"); + while(t!=27){ + t=getch(); + continue; + } + if(t==27){ + UserMenu(); + } + } + + } + } + + + + } +} + +//Ϣ +void LooBook(int n){ + system("cls"); + while(1){ + char t; + printf("******************************************************************************************\n"); + printf("* ͼϵͳVersion 1.0 *\n"); + printf("******************************************************************************************\n"); + printf("* *\n"); + printf("* ʽ *\n"); + printf("* *\n"); + printf("* 1 *\n"); + printf("* *\n"); + printf("* 2߲ *\n"); + printf("* *\n"); + printf("* 3 *\n"); + printf("* *\n"); + printf("* ESC *\n"); + printf("******************************************************************************************\n"); + printf("\n\n\t\t\t\t\t\t\t\t\tִеIJ"); + t=getch(); + while(t!='1'&&t!='2'&&t!='3'&&t!=27){ + t=getch(); + continue; + } + if(t=='1'){ + SBNam(n); + break; + }else if(t=='2'){ + SBAut(n); + break; + }else if(t=='3'){ + SBCat(n); + break; + }else if(t==27){ + if(n==0){ + UserMenu(); + }else if(n==1){ + AdminMenu(); + } + break; + } + + } +} + +void SBAut(int q){ + system("cls"); + struct Book *head; + struct Book *p1,*p2; + FILE *fp; + int n=0; + int m=0,Many=0; + float Price=0; + char t,ReName[100]; + int i=0,k=0,j=0; + char Num[20]={'\0'},Aut[20]={'\0'},Pub[20]={'\0'},Nam[20]={'\0'},Cat[20]={'\0'}; + if((fp=fopen("ͼ.txt","r"))==NULL){ + printf("޷򿪸ļ\n"); + printf("ESC\n"); + t=getch(); + while(t!=27){ + t=getch(); + continue; + } + UserMenu(); + } + else{ + printf("Ҫ֣\n"); + scanf("%s",ReName); + j=Total(); + for(int i=0;inext =p1; + p2=p1; + p1=(struct Book*)malloc(LEN); + } + strcpy(p1->num,Num);// + strcpy(p1->nam,Nam);// + strcpy(p1->aut,Aut);// + strcpy(p1->pub,Pub);//Ƴ + strcpy(p1->cat,Cat);// + p1->many=Many;//Ƹ + p1->price=Price;//Ƶ + } + } + if(n==0){ + head=NULL; + }else{ + p2->next=p1; + p1->next=NULL; + fclose(fp); + } +} + fp=fopen("ͼ.txt","w"); + fclose(fp); + fp=fopen("ͼ.txt","a"); + p=head; + + for(;p!=NULL;){ + fprintf(fp,"%-8s%-9s%-14s%-16s%-18s%-7d%-8.2f\n",p->num,p->nam,p->aut,p->pub,p->cat,p->many,p->price); + p=p->next; + } + fclose(fp); + system("cls"); + printf("ɾɹһ\n"); + t=getch(); + AdminMenu(); +} + +//޸鼮 +void FixBook(){ + system("cls"); + struct Book *head,*p1,*p2,*p; + int i,n; + char Rename[100]; + char Num[20],Nam[20],Aut[20],Pub[20],Cat[20]; + int Many; + float Price; + printf("Ҫ޸ͼ"); + scanf("%s",Rename); + FILE *fp; + fp = fopen("ͼ.txt","r"); + n = Total(); + int count=0; + int k=0; + for(i=0;inext=p1; + p2=p1; + p1=(struct Book*)malloc(LEN); + } + strcpy(p1->num,Num);// + strcpy(p1->nam,Nam);// + strcpy(p1->aut,Aut);// + strcpy(p1->pub,Pub);//Ƴ + strcpy(p1->cat,Cat);// + p1->many=Many;//Ƹ + p1->price=Price;//Ƶ + } + } + if(n==0){ + head = NULL; + } + else{ + p2->next=p1; + p1->next=NULL; + fclose(fp); + } + fp=fopen("ͼ.txt","w"); + fclose(fp); + fp=fopen("ͼ.txt","a"); + p=head; + + for(;p!=NULL;){ + fprintf(fp,"%-8s%-9s%-14s%-16s%-18s%-7d%-8.2f\n",p->num,p->nam,p->aut,p->pub,p->cat,p->many,p->price); + p=p->next; + } + fclose(fp); + fp = fopen("ͼ.txt","a"); + system("cls"); + printf("ţ");scanf("%s",Num); + printf("");scanf("%s",Nam); + printf("ߣ");scanf("%s",Aut); + printf("磺");scanf("%s",Pub); + printf("ͼ");scanf("%s",Cat); + printf("ͼ");scanf("%d",&Many); + printf("ͼ۸λС:");scanf("%f",&Price); + fprintf(fp,"%-8s%-9s%-14s%-16s%-18s%-7d%-8.2f\n",Num,Nam,Aut,Pub,Cat,Many,Price); + system("cls"); + printf("\n\n\n"); + printf("\t\t\t\n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t дͼϢ. \n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t\n"); + Sleep(500); + system("cls"); + printf("\n\n\n"); + printf("\t\t\t\n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t дͼϢ.. \n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t\n"); + Sleep(500); + system("cls"); + printf("\n\n\n"); + printf("\t\t\t\n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t дͼϢ... \n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t\n"); + Sleep(500); + system("cls"); + printf("\n\n\n"); + printf("\t\t\t\n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t дͼϢ. \n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t\n"); + Sleep(500); + system("cls"); + printf("\n\n\n"); + printf("\t\t\t\n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t дͼϢ.. \n"); + printf("\t\t\t \n"); + printf("\t\t\t \n"); + printf("\t\t\t\n"); + Sleep(500); + system("cls"); + printf("\n\n\n"); + printf("\t\t\t\n"); + printf("\t\t\t \n"); + printf("\t\t\t ɹǷҪ \n"); + printf("\t\t\t \n"); + printf("\t\t\tЩ\n"); + printf("\t\t\t 1. 2. \n"); + printf("\t\t\t \n"); + fclose(fp); + char t; + while(1) //ѭЧֹ + { + t=getch(); + if(t=='1') AddBook(); + else if(t=='2') AdminMenu(); + } +} + //ͳͼ +int Total(){ + FILE *fp; + int txcl=0,n; + float tprice=0; + char tname[20]={'\0'},tauthor[20]={'\0'},tchuban[20]={'\0'},tkind[20]={'\0'},tshuhao[20]={'\0'}; + + fp=fopen("ͼ.txt","r");//ļ + + for (n=0;!feof(fp);n++)//ļ + fscanf(fp,"%s%s%s%s%s%d%f",tshuhao,tname,tauthor,tchuban,tkind,&txcl,&tprice); + n--;//ȥһ + fclose(fp);//رļ + return (n);//ظ +} +//ͳ˺ +int Total1(){ + int n; + char name[100],password[100]; + FILE *fp=fopen("˺Ź.txt","r"); + for(n=0;!feof(fp);n++){ + fscanf(fp,"%s%s",name,password); + } + n--; + fclose(fp); + return (n); +} +//ͳƶ +int Total2(){ + int n; + int num; + char username[20],time[20],name[20]; + FILE *fp=fopen(".txt","r"); + for(n=0;!feof(fp);n++){ + fscanf(fp,"%d%s%s%s",&num,username,time,name); + } + n--; + fclose(fp); + return (n); +} +void Reader() +{ + system("cls"); + printf("******************************************************************************************\n"); + printf("* ͼϵͳVersion 1.0 *\n"); + printf("******************************************************************************************\n"); + printf("* *\n"); + printf("* ʽ *\n"); + printf("* *\n"); + printf("* 1˺Ų *\n"); + printf("* *\n"); + printf("* 2н *\n"); + printf("* *\n"); + printf("* ESC *\n"); + printf("******************************************************************************************\n"); + printf("\n\n\t\t\t\t\t\t\t\t\tִеIJ"); + char op; + while(1) + { + op = getch(); + if(op=='1') Readername(); + else if(op=='2') Allreader(); + else if(op==27) AdminMenu(); + } +} + +void Readername() +{ + system("cls"); + printf("鿴Ķߵ֣"); + char Name[100]; + char username[100],time[100],name[100]; + int num; + scanf("%s",Name); + FILE *fp; + fp = fopen(".txt","r"); + int n = Total2(); + int i;int count=0; + for(i=0;i