#include ""#include<>#include ""#include<>#include<>#include ""#include<>#include<>FILE *fp,*p ;void *buf=NULL;void main(){ void adm1(),adm2(),build(),huan(),borrow(),dele(),kaiji(); void anniu(int x1,int y1,int x2,int y2,int color,char *f); void no(); int d=VGA,m=VGAHI; initgraph(&d,&m,""); setmouse(0,629,0,459); settextstyle(3,0,1); kaiji(); buf=jiantou(buf); adm1(); adm2();}void adm1(){ char adp[20],password[20]; int i,n=0; textbackground(2); cleardevice(); fp=fopen("pass","r"); if(fp==NULL) { outtext("no exit ");getch();exit(0);} for(;;) { setcolor(2); anniu(150,1,300,20,0," "); setcolor(15); outtext("input password:"); gotoxy(20,1);gets(adp); for(i=0;adp[i]!='\0';i++); if(i==0) exit(0); fgets(password,i+1,fp); if(strcmp(password,adp)==0) { cleardevice();outtext("YES");getch();adm2();} else{ n++; cleardevice();outtext("error"); for(i=0;i<10;i++) delay(8000); if(n==2) { cleardevice(); outtext("once again");for(i=0;i<=10;i++) delay(8000);} if(n==3) { cleardevice(); outtext("3 second out");for(i=0;i<=10;i++) delay(8000); exit(0); } } fclose(fp);cleardevice(); }}void adm2() { char a; int i,j,x,y; clrscr(); cleardevice(); for(;;) { setbkcolor(6); setcolor(2); cleardevice(); anniu(12,40,190,70,15,"built a user (B)"); setcolor(2); anniu(12,90,190,120,15,"return book (R)"); setcolor(2); anniu(12,140,190,170,15,"borrow books (J)"); setcolor(2); anniu(12,190,190,220,15,"delete user (D)"); setcolor(2); anniu(12,240,190,270,15,"exit (E)"); do{ do{ i=readmouse(&x,&y,buf,1); ; int86(0x16,&r,&r); j=; if(j!=0) switch(j){ case 0x30:a='b';break; case 0x13:a='r';break; case 0x24:a='j';break; case 0x20:a='d';break; case 0x12:a='e';break; } } while(i!=1&&j==0); if((x>12&&x<190&&y>40&y<70&&i==1)||a=='b') { setcolor(2); anniu(12,40,190,70,2,"built a user (B)"); delay(80000); build(); } if((x>12&&x<190&&y>90&y<120&&i==1)||a=='r') { setcolor(2); anniu(12,90,190,120,2,"return book (R)"); delay(80000); huan(); } if((x>12&&x<190&&y>140&y<170&&i==1)||a=='j') {setcolor(2); anniu(12,140,190,170,2,"borrow books (J)"); delay(80000); borrow(); } if((x>12&&x<190&&y>190&y<220&&i==1)||a=='d') { setcolor(2); anniu(12,190,190,220,2,"delete user (D)"); delay(80000); dele(); } if((x>12&&x<190&&y>240&y<270&&i==1)||a=='e') {setcolor(2); anniu(12,240,190,270,2,"exit (E)"); closegraph(); showBMP(""); for(i=0;i<100;i++)delay(10000); exit(0); } i=0;j=0; }while(i==0&&j==0); } }void anniu(int x1,int y1,int x2,int y2,int color,char *f) { setfillstyle(1,color); rectangle(x1,y1,x2,y2); floodfill(x1+1,y1+1,2); setcolor(1); outtextxy(20,y1+10,f); }void build() { FILE *f; char id[20],name[20],sex[2],age[3],grad[50]; cleardevice(); printf("ID number:"); scanf("%s",id); printf("name:"); scanf("%s",name); printf("sex:"); scanf("%s",sex); printf("grad:"); scanf("%s",grad); p=fopen(id,"w+"); if(p==NULL) { no("can't build it");getch();adm2();} fprintf(p,"%s ",name); fprintf(p,"%s ",id); fprintf(p,"%s ",sex); fprintf(p,"%s ",grad); no("bulid success"); getch(); fclose(p); adm2(); }void huan(){ FILE *fp,*p; char id[20],a[5][50],name[20],c; int i=0,m,k; cleardevice(); printf("input ID number:"); scanf("%s",id); p=fopen(id,"r"); if(p==NULL) { no("user no exit");getch();fclose(p);adm2();} fscanf(p,"%s",name); fclose(p); fp=fopen(name,"r"); while(!feof(fp)){ fscanf(fp,"%s",a[i++]); } for(k=0;k=5); for(k=i;k