|
|
|
|
#include<stdio.h>
|
|
|
|
|
#include<stdlib.h>
|
|
|
|
|
#include<windows.h>
|
|
|
|
|
#include<string.h>
|
|
|
|
|
#include <conio.h>
|
|
|
|
|
struct airstruct //*<2A><><EFBFBD><EFBFBD>*//
|
|
|
|
|
{
|
|
|
|
|
int runway; //*<2A>ܵ<EFBFBD><DCB5><EFBFBD>*//
|
|
|
|
|
char airstatus[20]; //*״̬*//
|
|
|
|
|
char start[20]; //*<2A><><EFBFBD><EFBFBD>*//
|
|
|
|
|
char des[20]; //*Ŀ<>ĵ<EFBFBD>*//
|
|
|
|
|
char airname[20]; //*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*//
|
|
|
|
|
char time[20]; //*<2A><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>*//
|
|
|
|
|
int count; //<2F><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>//
|
|
|
|
|
struct airstruct *next; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>//
|
|
|
|
|
};
|
|
|
|
|
struct userstruct
|
|
|
|
|
{
|
|
|
|
|
char username[20]; //<2F>û<EFBFBD><C3BB><EFBFBD>
|
|
|
|
|
char usermm[100]; //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
char name[20]; //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
char sex[20]; //<2F>Ա<EFBFBD>
|
|
|
|
|
char tele[20]; // <20>绰
|
|
|
|
|
char id[20]; //<2F><><EFBFBD><EFBFBD>֤
|
|
|
|
|
int aircount1; // <20><><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>
|
|
|
|
|
char uairname[20][20]; // <20>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><C4BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>( <20><>ά<EFBFBD><CEAC><EFBFBD>鴢<EFBFBD><E9B4A2><EFBFBD><EFBFBD>Ϣ <20><>ͬ )
|
|
|
|
|
char ustart[20][20]; //<2F><><EFBFBD><EFBFBD>//
|
|
|
|
|
char udes[20][20]; //<2F>յ<EFBFBD>//
|
|
|
|
|
char utime[20][20]; //<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>//
|
|
|
|
|
int urunway[20]; //<2F>ܵ<EFBFBD><DCB5><EFBFBD>//
|
|
|
|
|
struct userstruct *next; //<2F>û<EFBFBD><C3BB><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>//
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
struct adminstruct
|
|
|
|
|
{
|
|
|
|
|
char adminname[20]; //<2F><><EFBFBD><EFBFBD>Ա<EFBFBD>û<EFBFBD><C3BB><EFBFBD>//
|
|
|
|
|
char adminmm[100]; //<2F><><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>//
|
|
|
|
|
struct adminstruct *next; //<2F><><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
};
|
|
|
|
|
struct superstruct
|
|
|
|
|
{
|
|
|
|
|
char supername[20]; //ͬ<><CDAC>
|
|
|
|
|
char supermm[100];
|
|
|
|
|
struct superstruct *next;
|
|
|
|
|
};
|
|
|
|
|
struct airstruct *airhead=NULL,*airend =NULL; //<2F><>ʼ<EFBFBD><CABC>ͷָ<CDB7><D6B8><EFBFBD><EFBFBD>βָ<CEB2><D6B8>Ϊ<EFBFBD><CEAA>(<28><>ͬ)
|
|
|
|
|
struct userstruct *userhead=NULL,*userend =NULL;
|
|
|
|
|
struct adminstruct *adminhead=NULL,*adminend =NULL;
|
|
|
|
|
struct superstruct *superhead =NULL,*superend =NULL;
|
|
|
|
|
int aircount,usercount,admincount,supercount; //*ȫ<>ֱ<EFBFBD><D6B1><EFBFBD>(<28><><EFBFBD>࣬<EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>)*//
|
|
|
|
|
void airfile(); //<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
void userfile(); //<2F>û<EFBFBD><C3BB>ļ<EFBFBD>
|
|
|
|
|
void adminfile(); //<2F><><EFBFBD><EFBFBD>Ա
|
|
|
|
|
void superfile(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա
|
|
|
|
|
void writefile(int flag); //д<>ļ<EFBFBD>
|
|
|
|
|
void home(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
void dengru(); //<2F><>½<EFBFBD><C2BD><EFBFBD><EFBFBD>
|
|
|
|
|
void userlogin(); //<2F>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
void userfunction(struct userstruct *p); // <20>û<EFBFBD><C3BB><EFBFBD><EFBFBD>ܽ<EFBFBD><DCBD><EFBFBD>
|
|
|
|
|
void u_search(); //<2F>û<EFBFBD><C3BB><EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>
|
|
|
|
|
void u_book(struct userstruct *userp); //<2F>û<EFBFBD><C3BB><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>
|
|
|
|
|
void u_exit(struct userstruct *userp); //<2F>û<EFBFBD><C3BB><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>
|
|
|
|
|
void u_rivese(struct userstruct *userp); //<2F>û<EFBFBD><C3BB>ĸ<DEB8><C4B8><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>
|
|
|
|
|
void adminlogin(); //<2F><><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1>½<EFBFBD><C2BD><EFBFBD><EFBFBD>
|
|
|
|
|
void adminfunction(); //<2F><><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ܽ<EFBFBD><DCBD><EFBFBD>
|
|
|
|
|
void superlogin(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1>½<EFBFBD><C2BD><EFBFBD><EFBFBD>
|
|
|
|
|
void superfunction(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1>½<EFBFBD><C2BD><EFBFBD><EFBFBD>
|
|
|
|
|
void a_research1(); //<2F><><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ų<EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
void a_research2(); //<2F><><EFBFBD>ܵ<EFBFBD><DCB5>Ų<EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
void a_research3(); //<2F><><EFBFBD>û<EFBFBD><C3BB><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD>û<EFBFBD><C3BB><EFBFBD>Ϣ
|
|
|
|
|
void a_add(); //<2F><><EFBFBD>Ӻ<EFBFBD><D3BA><EFBFBD>
|
|
|
|
|
void a_rivese1(); //<2F><><EFBFBD><EFBFBD>Ա<EFBFBD>ĺ<DEB8><C4BA><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
void changeuser(char *s,char *s1,int a); //<2F><EFBFBD><DEB8>Ѷ<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD>û<EFBFBD><C3BB>ĺ<EFBFBD><C4BA><EFBFBD><EFBFBD><EFBFBD>Ϣ void a_rivese1()<29>Ӻ<EFBFBD><D3BA><EFBFBD> <20><EFBFBD><DEB8><EFBFBD>ϢΪchar<61><72>
|
|
|
|
|
void changeuser1(char *s,int a); //<2F><EFBFBD><DEB8>Ѷ<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD>û<EFBFBD><C3BB>ĺ<EFBFBD><C4BA><EFBFBD><EFBFBD><EFBFBD>Ϣ void a_rivese1()<29>Ӻ<EFBFBD><D3BA><EFBFBD> <20><EFBFBD><DEB8><EFBFBD>ϢΪint<6E><74>
|
|
|
|
|
void deleteair(); //<2F><><EFBFBD><EFBFBD>Աɾ<D4B1><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
void deleteuser(); //ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԱҪɾ<D2AA><C9BE><EFBFBD>ģ<EFBFBD><C4A3>Ѷ<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD>û<EFBFBD><C3BB>ĺ<EFBFBD><C4BA><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
void s_add(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӹ<EFBFBD><D3B9><EFBFBD>Ա
|
|
|
|
|
void s_delete(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Աɾ<D4B1><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա
|
|
|
|
|
void zhuce();
|
|
|
|
|
void userrigester(); //<2F>û<EFBFBD>ע<EFBFBD><D7A2>
|
|
|
|
|
void superrigerster(); ////<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Աע<D4B1>ᣨ<EFBFBD><E1A3A8>Ҫ<EFBFBD><D2AA>ʼ<EFBFBD><CABC><EFBFBD>룩
|
|
|
|
|
|
|
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
FILE *fp;
|
|
|
|
|
airhead = (struct airstruct *)malloc(sizeof(struct airstruct)); //<2F><>ͷָ<CDB7><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ棨<DAB4><E6A3A8>ͬ<EFBFBD><CDAC>
|
|
|
|
|
userhead = (struct userstruct *)malloc(sizeof(struct userstruct));
|
|
|
|
|
adminhead = (struct adminstruct *)malloc(sizeof(struct adminstruct));
|
|
|
|
|
superhead = (struct superstruct *)malloc(sizeof(struct superstruct)); //<2F><><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>
|
|
|
|
|
fp=fopen("air","a+"); //<2F><>һ<EFBFBD>ν<EFBFBD><CEBD><EFBFBD>air<69>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><D7B7>
|
|
|
|
|
aircount=fread(airhead,sizeof(struct airstruct),1,fp); //<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
fclose(fp); //<2F>ر<EFBFBD><D8B1>ļ<EFBFBD>
|
|
|
|
|
airend=airhead;
|
|
|
|
|
airfile();
|
|
|
|
|
fp=fopen("user","a+");
|
|
|
|
|
usercount=fread(userhead,sizeof(struct userstruct),1,fp);
|
|
|
|
|
fclose(fp);
|
|
|
|
|
userend=userhead;
|
|
|
|
|
userfile();
|
|
|
|
|
fp=fopen("admin","a+");
|
|
|
|
|
admincount=fread(adminhead,sizeof(struct adminstruct),1,fp);
|
|
|
|
|
fclose(fp);
|
|
|
|
|
adminend=adminhead;
|
|
|
|
|
adminfile();
|
|
|
|
|
fp=fopen("super","a+");
|
|
|
|
|
supercount=fread(superhead,sizeof(struct superstruct),1,fp);
|
|
|
|
|
fclose(fp);
|
|
|
|
|
superend=superhead;
|
|
|
|
|
superfile();
|
|
|
|
|
home();
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
int isexist(char *name,int flag) //<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>//
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (flag == 0)
|
|
|
|
|
{
|
|
|
|
|
struct userstruct *p;
|
|
|
|
|
p = userhead;
|
|
|
|
|
while (p != NULL)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(name, p->username) == 0)
|
|
|
|
|
return 1;
|
|
|
|
|
p = p->next;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (flag == 1)
|
|
|
|
|
{
|
|
|
|
|
struct adminstruct *p;
|
|
|
|
|
p = adminhead;
|
|
|
|
|
while (p != NULL)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(name, p->adminname) == 0)
|
|
|
|
|
return 1;
|
|
|
|
|
p = p->next;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (flag == 2)
|
|
|
|
|
{
|
|
|
|
|
struct superstruct *p;
|
|
|
|
|
p = superhead;
|
|
|
|
|
while (p != NULL)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(name, p->supername) == 0)
|
|
|
|
|
return 1;
|
|
|
|
|
p = p->next;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(flag == 3)
|
|
|
|
|
{
|
|
|
|
|
struct airstruct *p;
|
|
|
|
|
p = airhead;
|
|
|
|
|
while (p != NULL)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(name, p->airname) == 0)
|
|
|
|
|
return 1;
|
|
|
|
|
p = p->next;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void home()
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
int end=0;
|
|
|
|
|
while(1)
|
|
|
|
|
{
|
|
|
|
|
system("cls"); //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
system("color 0F");
|
|
|
|
|
printf("\n\n\n\n\n\n");
|
|
|
|
|
printf("\n\n ***********<2A><>ӭ<EFBFBD><D3AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ************ \n\n");
|
|
|
|
|
printf("~ 1 <20><>½ ~\n");
|
|
|
|
|
printf("~ 2 ע<><D7A2> ~\n");
|
|
|
|
|
printf("~ 0 <20>˳<EFBFBD> ~\n");
|
|
|
|
|
printf("\n\n <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD>еIJ<D0B5><C4B2><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%d",&i);
|
|
|
|
|
switch(i)
|
|
|
|
|
{
|
|
|
|
|
case 1:dengru();break;
|
|
|
|
|
case 2:zhuce();break;
|
|
|
|
|
case 0:end=1;break;
|
|
|
|
|
default:printf(" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!<21><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺");
|
|
|
|
|
system("pause");
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if(end==1) break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
void dengru()
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
int end=0;
|
|
|
|
|
while(1)
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
|
|
|
|
|
SetConsoleTextAttribute(handle, FOREGROUND_INTENSITY | FOREGROUND_RED| FOREGROUND_GREEN); //<2F><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>
|
|
|
|
|
printf("\n\n\n\n\n\n");
|
|
|
|
|
printf(" 1 <20>û<EFBFBD><C3BB><EFBFBD>½\n");
|
|
|
|
|
printf(" 2 <20><><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1>½\n");
|
|
|
|
|
printf(" 3 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1>½\n");
|
|
|
|
|
printf(" 0 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>\n");
|
|
|
|
|
printf("\n\n\n");
|
|
|
|
|
printf(" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD>еIJ<D0B5><C4B2><EFBFBD><EFBFBD><EFBFBD> ");
|
|
|
|
|
scanf("%d",&i);
|
|
|
|
|
switch(i)
|
|
|
|
|
{
|
|
|
|
|
case 1:userlogin();break;
|
|
|
|
|
case 2:adminlogin();break;
|
|
|
|
|
case 3:superlogin();break;
|
|
|
|
|
case 0:end=1;break;
|
|
|
|
|
default:printf(" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!<21><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺\n ");
|
|
|
|
|
system("pause");
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if(end==1)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void userlogin()
|
|
|
|
|
{
|
|
|
|
|
struct userstruct *p;
|
|
|
|
|
char username[20];
|
|
|
|
|
char usermm[100];
|
|
|
|
|
int exist=0;
|
|
|
|
|
FILE *fp;
|
|
|
|
|
int i;
|
|
|
|
|
p=userhead;
|
|
|
|
|
system("cls");
|
|
|
|
|
system("color 0A");
|
|
|
|
|
printf("\n\n\n\n\n\n\n");
|
|
|
|
|
printf("**************************************************************");
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>Ϣ: \n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
gets(username);
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
for(i=0;i<100;i++)
|
|
|
|
|
{
|
|
|
|
|
usermm[i]=getch();
|
|
|
|
|
if(usermm[i]!=13&&usermm[i]!=8)
|
|
|
|
|
{
|
|
|
|
|
printf("*");
|
|
|
|
|
}
|
|
|
|
|
if(usermm[i]==8)
|
|
|
|
|
{
|
|
|
|
|
printf("\b");
|
|
|
|
|
i--;
|
|
|
|
|
printf(" ");
|
|
|
|
|
printf("\b");
|
|
|
|
|
i--;
|
|
|
|
|
}
|
|
|
|
|
if(usermm[i]==13)
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
usermm[i]='\0';
|
|
|
|
|
printf("\n**************************************************************");
|
|
|
|
|
printf("\n\n\n\n\n\n\n");
|
|
|
|
|
while (p != NULL)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(p->username, username) == 0)
|
|
|
|
|
{
|
|
|
|
|
exist=1;
|
|
|
|
|
while(strcmp(p->usermm,usermm) != 0)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!<21><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
gets(usermm);
|
|
|
|
|
}
|
|
|
|
|
printf("<EFBFBD>û<EFBFBD>%s<><73>½<EFBFBD>ɹ<EFBFBD>!3<><33><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD>ת<EFBFBD><D7AA><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>...", p->username);
|
|
|
|
|
Sleep(3000);
|
|
|
|
|
userfunction(p);
|
|
|
|
|
}
|
|
|
|
|
p = p->next;
|
|
|
|
|
}
|
|
|
|
|
if (!exist)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0>ע<EFBFBD><D7A2>...\n");
|
|
|
|
|
printf("3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...");
|
|
|
|
|
Sleep(3000);
|
|
|
|
|
zhuce();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void userfunction(struct userstruct *p) //<2F><>Ӧ<EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD> //
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
int end=0;
|
|
|
|
|
while(1)
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
|
|
|
|
|
SetConsoleTextAttribute(handle, FOREGROUND_INTENSITY | FOREGROUND_GREEN);
|
|
|
|
|
printf("\n\n\n\n\n\n");
|
|
|
|
|
printf(" 1 <20><>ѯ\n");
|
|
|
|
|
printf(" 2 <20><>Ʊ\n");
|
|
|
|
|
printf(" 3 <20><>Ʊ\n");
|
|
|
|
|
printf(" 4 <20>ĸ<DEB8><C4B8><EFBFBD><EFBFBD><EFBFBD>Ϣ\n");
|
|
|
|
|
printf(" 0 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>\n");
|
|
|
|
|
printf("\n\n\n");
|
|
|
|
|
printf(" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD>еIJ<D0B5><C4B2><EFBFBD><EFBFBD><EFBFBD> ");
|
|
|
|
|
scanf("%d",&i);
|
|
|
|
|
getchar();
|
|
|
|
|
switch(i)
|
|
|
|
|
{
|
|
|
|
|
case 1:u_search();break; //<2F><>ѯ
|
|
|
|
|
case 2:u_book(p);break; //<2F><>Ʊ
|
|
|
|
|
case 3:u_exit(p);break; //<2F><>Ʊ
|
|
|
|
|
case 4:u_rivese(p);break; //<2F>ĸ<DEB8><C4B8><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
case 0:end=1;break;
|
|
|
|
|
default:printf(" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!<21><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺");
|
|
|
|
|
system("pause");
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if(end==1)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void u_search()
|
|
|
|
|
{
|
|
|
|
|
struct airstruct *p;
|
|
|
|
|
char airname[20];
|
|
|
|
|
char start[20];
|
|
|
|
|
char des[20];
|
|
|
|
|
int exist = 0;
|
|
|
|
|
system("c0");
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("\n\n\n\n\n\n\n");
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>ѯ<EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
gets(start);
|
|
|
|
|
printf("\n");
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>ѯ<EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD>: ");
|
|
|
|
|
gets(des);
|
|
|
|
|
p = airhead;
|
|
|
|
|
while (p != NULL)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(p->start, start) == 0)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(p->des ,des)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:%s\n",p->airname );
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>㣺%s\n",p->start );
|
|
|
|
|
printf("<EFBFBD>յ㣺%s\n",p->des );
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>䣺%s\n",p->time );
|
|
|
|
|
printf("<EFBFBD>ܵ<EFBFBD><EFBFBD>ţ<EFBFBD>%d\n",p->runway);
|
|
|
|
|
printf("<EFBFBD><EFBFBD>Ʊ<EFBFBD><EFBFBD>%d\n",p->count);
|
|
|
|
|
exist=1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
p = p->next;
|
|
|
|
|
}
|
|
|
|
|
if (exist == 0)
|
|
|
|
|
printf("<EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...\n");
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
int n;
|
|
|
|
|
while (1)
|
|
|
|
|
{
|
|
|
|
|
scanf("%d", &n);
|
|
|
|
|
if (n == 0)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void u_book(struct userstruct *userp)
|
|
|
|
|
{
|
|
|
|
|
struct airstruct *p;
|
|
|
|
|
char start[20];
|
|
|
|
|
char des[20];
|
|
|
|
|
int exist = 0;
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>Ʊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
gets(start);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>Ʊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD>: ");
|
|
|
|
|
gets(des);
|
|
|
|
|
p = airhead;
|
|
|
|
|
while (p != NULL)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(start, p->start) == 0)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(des,p->des )==0)
|
|
|
|
|
{
|
|
|
|
|
printf("%s %d",p->des,p->count );
|
|
|
|
|
if (p->count == 0)
|
|
|
|
|
printf("<EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...");
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
p->count -= 1;
|
|
|
|
|
userp->aircount1++;
|
|
|
|
|
strcpy(userp->uairname[userp->aircount1 -1] ,p->airname );
|
|
|
|
|
strcpy(userp->ustart[userp->aircount1 -1] ,p->start );
|
|
|
|
|
strcpy(userp->udes[userp->aircount1 -1],p->des );
|
|
|
|
|
strcpy(userp->utime[userp->aircount1 -1],p->time );
|
|
|
|
|
userp->urunway[userp->aircount1 -1]=p->runway ;
|
|
|
|
|
writefile(0);
|
|
|
|
|
writefile(3);
|
|
|
|
|
exist = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
p = p->next;
|
|
|
|
|
}
|
|
|
|
|
if (exist == 0)
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!");
|
|
|
|
|
else
|
|
|
|
|
printf("\n%s<><73><EFBFBD>ඩƱ<E0B6A9>ɹ<EFBFBD>", p->airname);
|
|
|
|
|
printf("\n3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...");
|
|
|
|
|
Sleep(3000);
|
|
|
|
|
}
|
|
|
|
|
void u_exit(struct userstruct *userp)
|
|
|
|
|
{
|
|
|
|
|
struct airstruct *p;
|
|
|
|
|
char airname[20];
|
|
|
|
|
int count = userp->aircount1;
|
|
|
|
|
int exist;
|
|
|
|
|
int flag;
|
|
|
|
|
int end=0;
|
|
|
|
|
system("cls");
|
|
|
|
|
system("color 06");
|
|
|
|
|
p = airhead;
|
|
|
|
|
while (count--)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<EFBFBD>б<EFBFBD>:\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:%s ", userp->uairname[count]);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:%s ", userp->ustart[count]);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD>:%s ", userp->udes[count]);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>:%s ", userp->utime[count]);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܵ<EFBFBD><EFBFBD><EFBFBD>:%d\n", userp->urunway[count]);
|
|
|
|
|
}
|
|
|
|
|
printf("\n\n\n\n\n");
|
|
|
|
|
printf("**************************************************************");
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>Ʊ<EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
while (gets(airname))
|
|
|
|
|
{
|
|
|
|
|
exist = 0;
|
|
|
|
|
int i;
|
|
|
|
|
for (i = 0; i < userp->aircount1; i++)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(airname, userp->uairname[i])== 0)
|
|
|
|
|
{
|
|
|
|
|
flag = i;
|
|
|
|
|
exist = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!exist)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD>û<EFBFBD>д˻<EFBFBD>Ʊ...\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
printf("**************************************************************");
|
|
|
|
|
while (p != NULL)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(p->airname, airname) == 0)
|
|
|
|
|
{
|
|
|
|
|
p->count++;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
p = p->next;
|
|
|
|
|
}
|
|
|
|
|
int i;
|
|
|
|
|
for ( i = flag; i < userp->aircount1 - 1; i++)
|
|
|
|
|
{
|
|
|
|
|
strcpy(userp->uairname[i], userp->uairname[i + 1]);
|
|
|
|
|
strcpy(userp->ustart[i], userp->ustart[i + 1]);
|
|
|
|
|
strcpy(userp->udes[i], userp->udes[i + 1]);
|
|
|
|
|
strcpy(userp->utime[i], userp->utime[i + 1]);
|
|
|
|
|
userp->urunway[i]= userp->urunway[i + 1];
|
|
|
|
|
}
|
|
|
|
|
userp->aircount1--;
|
|
|
|
|
writefile(0);
|
|
|
|
|
writefile(3);
|
|
|
|
|
printf("\n%<25><>Ʊ<EFBFBD>ɹ<EFBFBD>...", airname);
|
|
|
|
|
printf("3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...");
|
|
|
|
|
Sleep(3000);
|
|
|
|
|
}
|
|
|
|
|
void u_rivese(struct userstruct *userp)
|
|
|
|
|
{
|
|
|
|
|
char username[200];
|
|
|
|
|
char usermm[100];
|
|
|
|
|
char name[2-0];
|
|
|
|
|
char sex[20];
|
|
|
|
|
char tele[20];
|
|
|
|
|
char id[20];
|
|
|
|
|
system("cls");
|
|
|
|
|
system("color 09");
|
|
|
|
|
int i;
|
|
|
|
|
int end=0;
|
|
|
|
|
printf("\n\n\n\n\n\n");
|
|
|
|
|
printf("**************************************************************\n");
|
|
|
|
|
printf("\t\t1.<2E><EFBFBD><DEB8>û<EFBFBD><C3BB><EFBFBD>\n");
|
|
|
|
|
printf("\t\t2.<2E><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
printf("\t\t3.<2E><EFBFBD><DEB8><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD>\n");
|
|
|
|
|
printf("\t\t4.<2E><EFBFBD><DEB8>Ա<EFBFBD>\n");
|
|
|
|
|
printf("\t\t5.<2E>ĵ绰<C4B5><E7BBB0><EFBFBD><EFBFBD>\n");
|
|
|
|
|
printf("\t\t6.<2E><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><D6A4>\n");
|
|
|
|
|
printf("\t\t0.<2E>˳<EFBFBD>");
|
|
|
|
|
printf("\n\n\n\n\n\n");
|
|
|
|
|
printf("**************************************************************\n");
|
|
|
|
|
while(1)
|
|
|
|
|
{
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>еIJ<EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
scanf("%d",&i);
|
|
|
|
|
printf("1");
|
|
|
|
|
getchar();
|
|
|
|
|
switch(i)
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
{
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
gets(username);
|
|
|
|
|
while(isexist(username, 0))
|
|
|
|
|
{
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
gets(username);
|
|
|
|
|
}
|
|
|
|
|
strcpy(userp->username ,username);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 2:
|
|
|
|
|
{
|
|
|
|
|
printf("\n\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
gets(usermm);
|
|
|
|
|
strcpy(userp->usermm ,usermm);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 3:
|
|
|
|
|
{
|
|
|
|
|
printf("\n\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
gets(name);
|
|
|
|
|
strcpy(userp->name ,name);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 4:
|
|
|
|
|
{
|
|
|
|
|
printf("\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD>: ");
|
|
|
|
|
gets(sex);
|
|
|
|
|
strcpy(userp->sex ,sex);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 5:
|
|
|
|
|
{
|
|
|
|
|
printf("\n\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ĺ<EFBFBD><EFBFBD>ĵ绰<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
gets(tele);
|
|
|
|
|
strcpy(userp->tele ,tele);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 6:
|
|
|
|
|
{
|
|
|
|
|
printf("\n\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD>:");
|
|
|
|
|
gets(id);
|
|
|
|
|
strcpy(userp->id ,id);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 0:
|
|
|
|
|
{
|
|
|
|
|
end=1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
default:printf("\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!\n\n");
|
|
|
|
|
//system("pause");
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if(end==1)
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("\t\t<EFBFBD>ijɹ<EFBFBD>!");
|
|
|
|
|
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
printf("\n\t\t<EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>:%s",userp->username );
|
|
|
|
|
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:%s",userp->usermm );
|
|
|
|
|
printf("\n\t\t<EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:%s",userp->name );
|
|
|
|
|
printf("\n\t\t<EFBFBD>Ա<EFBFBD>:%s",userp->sex );
|
|
|
|
|
printf("\n\t\t<EFBFBD>绰<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:%s",userp->tele );
|
|
|
|
|
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD>:%s\n\t\t",userp->id );
|
|
|
|
|
system("pause");
|
|
|
|
|
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...");
|
|
|
|
|
writefile(0);
|
|
|
|
|
Sleep(3000);
|
|
|
|
|
}
|
|
|
|
|
void adminlogin()
|
|
|
|
|
{
|
|
|
|
|
int exit=0;
|
|
|
|
|
int i;
|
|
|
|
|
struct adminstruct *p;
|
|
|
|
|
char adminname[20];
|
|
|
|
|
char adminmm[100];
|
|
|
|
|
p = adminhead;
|
|
|
|
|
system("cls");
|
|
|
|
|
system("color 0B");
|
|
|
|
|
printf("\n\n\n\n\n\n\n");
|
|
|
|
|
printf("**************************************************************");
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD>Ϣ: \n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD>˺<EFBFBD>: ");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
gets(adminname);
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
for(i=0;i<100;i++)
|
|
|
|
|
{
|
|
|
|
|
adminmm[i]=getch();
|
|
|
|
|
if(adminmm[i]!=13&&adminmm[i]!=8)
|
|
|
|
|
{
|
|
|
|
|
printf("*");
|
|
|
|
|
}
|
|
|
|
|
if(adminmm[i]==8)
|
|
|
|
|
{
|
|
|
|
|
printf("\b");
|
|
|
|
|
i--;
|
|
|
|
|
printf(" ");
|
|
|
|
|
printf("\b");
|
|
|
|
|
i--;
|
|
|
|
|
}
|
|
|
|
|
if(adminmm[i]==13)
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
adminmm[i]='\0';
|
|
|
|
|
printf("\n\n**************************************************************");
|
|
|
|
|
printf("\n\n\n\n\n\n\n");
|
|
|
|
|
while (p != NULL)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(p->adminname, adminname) == 0)
|
|
|
|
|
{
|
|
|
|
|
exit=1;
|
|
|
|
|
while (strcmp(p->adminmm, adminmm) != 0)
|
|
|
|
|
{
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!<21><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
printf("adminmm: ");
|
|
|
|
|
gets(adminmm);
|
|
|
|
|
}
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա%s<><73>½<EFBFBD>ɹ<EFBFBD>!3<><33><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>...", p->adminname);
|
|
|
|
|
Sleep(3000);
|
|
|
|
|
adminfunction();
|
|
|
|
|
}
|
|
|
|
|
p = p->next;
|
|
|
|
|
}
|
|
|
|
|
if(exit==0)
|
|
|
|
|
{
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!");
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD>...");
|
|
|
|
|
Sleep(3000);
|
|
|
|
|
dengru();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void adminfunction() //<2F><><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>//
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
int end=0;
|
|
|
|
|
system("color 03");
|
|
|
|
|
while(1)
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
|
|
|
|
|
SetConsoleTextAttribute(handle, FOREGROUND_INTENSITY| FOREGROUND_RED);
|
|
|
|
|
printf("\n\n\n\n\n\n");
|
|
|
|
|
printf("\t\t1 ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ų<EFBFBD>ѯ\n");
|
|
|
|
|
printf("\t\t2 ͨ<><CDA8><EFBFBD>ܵ<EFBFBD><DCB5>Ų<EFBFBD>ѯ\n");
|
|
|
|
|
printf("\t\t3 ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ\n");
|
|
|
|
|
printf("\t\t4 <20><><EFBFBD>Ӻ<EFBFBD><D3BA><EFBFBD>\n");
|
|
|
|
|
printf("\t\t5 <20>ĺ<DEB8><C4BA><EFBFBD><EFBFBD><EFBFBD>Ϣ\n");
|
|
|
|
|
printf("\t\t6 ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ\n");
|
|
|
|
|
printf("\t\t0 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>\n");
|
|
|
|
|
printf("\n\n\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>еIJ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ");
|
|
|
|
|
scanf("%d",&i);
|
|
|
|
|
getchar();
|
|
|
|
|
switch(i)
|
|
|
|
|
{
|
|
|
|
|
case 1:a_research1();break;
|
|
|
|
|
case 2:a_research2();break;
|
|
|
|
|
case 3:a_research3();break;
|
|
|
|
|
case 4:a_add();break;
|
|
|
|
|
case 5:a_rivese1();break;
|
|
|
|
|
case 6:deleteair();break;
|
|
|
|
|
case 0:end=1;break;
|
|
|
|
|
default:printf("\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!<21><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺\n\t\t");
|
|
|
|
|
system("pause");
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if(end==1)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void superlogin()
|
|
|
|
|
{
|
|
|
|
|
struct superstruct *p;
|
|
|
|
|
char supername[20];
|
|
|
|
|
char supermm[100];
|
|
|
|
|
p = superhead;
|
|
|
|
|
int exist=0;
|
|
|
|
|
int i;
|
|
|
|
|
system("cls");
|
|
|
|
|
system("color 0C");
|
|
|
|
|
printf("\n\n\n\n\n\n\n");
|
|
|
|
|
printf("**************************************************************");
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD>Ϣ: \n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>볬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD>˺<EFBFBD>: ");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
gets(supername);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
for(i=0;i<100;i++)
|
|
|
|
|
{
|
|
|
|
|
supermm[i]=getch();
|
|
|
|
|
if(supermm[i]!=13&&supermm[i]!=8)
|
|
|
|
|
{
|
|
|
|
|
printf("*");
|
|
|
|
|
}
|
|
|
|
|
if(supermm[i]==8)
|
|
|
|
|
{
|
|
|
|
|
printf("\b");
|
|
|
|
|
i--;
|
|
|
|
|
printf(" ");
|
|
|
|
|
printf("\b");
|
|
|
|
|
i--;
|
|
|
|
|
}
|
|
|
|
|
if(supermm[i]==13)
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
supermm[i]='\0';
|
|
|
|
|
printf("\n**************************************************************");
|
|
|
|
|
printf("\n\n\n\n\n\n\n");
|
|
|
|
|
while (p != NULL)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(p->supername, supername) == 0)
|
|
|
|
|
{
|
|
|
|
|
exist = 1;
|
|
|
|
|
while(strcmp(p->supermm, supermm) != 0)
|
|
|
|
|
{
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!<21><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
gets(supermm);
|
|
|
|
|
}
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա%s<><73>½<EFBFBD>ɹ<EFBFBD>!3<><33><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>...", p->supername);
|
|
|
|
|
Sleep(3000);
|
|
|
|
|
superfunction();
|
|
|
|
|
}
|
|
|
|
|
p = p->next;
|
|
|
|
|
}
|
|
|
|
|
if (!exist)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0>ע<EFBFBD><D7A2>...\n");
|
|
|
|
|
printf("3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD>...");
|
|
|
|
|
Sleep(3000);
|
|
|
|
|
zhuce();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void superfunction()
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
int end=0;
|
|
|
|
|
system("color 01");
|
|
|
|
|
while(1)
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
|
|
|
|
|
SetConsoleTextAttribute(handle, FOREGROUND_INTENSITY| FOREGROUND_RED);
|
|
|
|
|
printf("\n\n\n\n\n\n");
|
|
|
|
|
printf("\t\t1 <20><><EFBFBD>ӹ<EFBFBD><D3B9><EFBFBD>Ա\n");
|
|
|
|
|
printf("\t\t2 ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա\n");
|
|
|
|
|
printf("\t\t0 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>\n");
|
|
|
|
|
printf("\n\n\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>еIJ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ");
|
|
|
|
|
scanf("%d",&i);
|
|
|
|
|
getchar();
|
|
|
|
|
switch(i)
|
|
|
|
|
{
|
|
|
|
|
case 1:s_add();
|
|
|
|
|
case 2:s_delete();
|
|
|
|
|
case 0:end=1;break;
|
|
|
|
|
default:printf("\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!<21><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺");
|
|
|
|
|
system("pause");
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if(end==1)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void a_research1()
|
|
|
|
|
{
|
|
|
|
|
struct airstruct *p;
|
|
|
|
|
char airname[20];
|
|
|
|
|
int exist = 0;
|
|
|
|
|
system("cls");
|
|
|
|
|
system("color 0b");
|
|
|
|
|
printf("\n\n\n\n\n\n\n");
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>ѯ<EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
gets(airname);
|
|
|
|
|
p = airhead;
|
|
|
|
|
while (p != NULL)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(p->airname, airname) == 0)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:%s\n",p->airname );
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>㣺%s\n",p->start );
|
|
|
|
|
printf("<EFBFBD>յ㣺%s\n",p->des );
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>䣺%s\n",p->time );
|
|
|
|
|
printf("<EFBFBD>ܵ<EFBFBD><EFBFBD>ţ<EFBFBD>%d\n",p->runway);
|
|
|
|
|
printf("<EFBFBD><EFBFBD>Ʊ<EFBFBD><EFBFBD>%d",p->count );
|
|
|
|
|
exist=1;
|
|
|
|
|
}
|
|
|
|
|
p = p->next;
|
|
|
|
|
}
|
|
|
|
|
if (exist == 0)
|
|
|
|
|
printf("<EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...\n");
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><EFBFBD><EFBFBD>ع<EFBFBD>·Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
int n;
|
|
|
|
|
while (1)
|
|
|
|
|
{
|
|
|
|
|
scanf("%d", &n);
|
|
|
|
|
if (n == 0)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void a_research2()
|
|
|
|
|
{
|
|
|
|
|
struct airstruct *p;
|
|
|
|
|
int runway;
|
|
|
|
|
int exist = 0;
|
|
|
|
|
system("color 0D");
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("\n\n\n\n\n\n\n");
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>ѯ<EFBFBD><EFBFBD><EFBFBD>ܵ<EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
scanf("%d",&runway);
|
|
|
|
|
p = airhead;
|
|
|
|
|
while (p != NULL)
|
|
|
|
|
{
|
|
|
|
|
if (p->runway == runway)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:%s\n",p->airname );
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>㣺%s\n",p->start );
|
|
|
|
|
printf("<EFBFBD>յ㣺%s\n",p->des );
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>䣺%s\n",p->time );
|
|
|
|
|
printf("<EFBFBD>ܵ<EFBFBD><EFBFBD>ţ<EFBFBD>%d\n",p->runway);
|
|
|
|
|
printf("<EFBFBD><EFBFBD>Ʊ<EFBFBD><EFBFBD>%d",p->count );
|
|
|
|
|
exist=1;
|
|
|
|
|
}
|
|
|
|
|
p = p->next;
|
|
|
|
|
}
|
|
|
|
|
if (exist == 0)
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD>ܵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ...\n");
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><EFBFBD><EFBFBD>ع<EFBFBD>·Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
int n;
|
|
|
|
|
while (1)
|
|
|
|
|
{
|
|
|
|
|
scanf("%d", &n);
|
|
|
|
|
if (n == 0)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void a_research3()
|
|
|
|
|
{
|
|
|
|
|
struct userstruct *p;
|
|
|
|
|
char name[20];
|
|
|
|
|
int exist = 0;
|
|
|
|
|
system("color 04");
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("\n\n\n\n\n\n\n");
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>ѯ<EFBFBD>ij˿<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n");
|
|
|
|
|
gets(name);
|
|
|
|
|
p = userhead;
|
|
|
|
|
while (p != NULL)
|
|
|
|
|
{
|
|
|
|
|
int count=p->aircount1 ;
|
|
|
|
|
if (strcmp(p->name, name) == 0)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>\n");
|
|
|
|
|
printf("<EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>:%s",p->username );
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:%s\n",p->name );
|
|
|
|
|
printf("<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD>%s\n",p->sex);
|
|
|
|
|
printf("<EFBFBD>绰<EFBFBD><EFBFBD>%s\n",p->tele );
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD>ţ<EFBFBD>%s\n",p->id );
|
|
|
|
|
while (count--)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<EFBFBD>б<EFBFBD>:\n");
|
|
|
|
|
printf("%s ", p->uairname[count]);
|
|
|
|
|
printf("%s ", p->ustart[count]);
|
|
|
|
|
printf("%s ", p->udes[count]);
|
|
|
|
|
printf("%s ", p->utime[count]);
|
|
|
|
|
printf("%d\n", p->urunway[count]);
|
|
|
|
|
}
|
|
|
|
|
exist=1;
|
|
|
|
|
}
|
|
|
|
|
p = p->next;
|
|
|
|
|
}
|
|
|
|
|
if (exist == 0)
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...\n");
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><EFBFBD><EFBFBD>ع<EFBFBD>·Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
int n;
|
|
|
|
|
while (1)
|
|
|
|
|
{
|
|
|
|
|
scanf("%d", &n);
|
|
|
|
|
if (n == 0)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void a_add()
|
|
|
|
|
{
|
|
|
|
|
struct airstruct *p;
|
|
|
|
|
FILE *fp;
|
|
|
|
|
system("cls");
|
|
|
|
|
system("color 03");
|
|
|
|
|
char airname[10];
|
|
|
|
|
if(aircount==0)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뺽<EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
gets(airname);
|
|
|
|
|
strcpy(airhead->airname ,airname);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
scanf("%s",airhead->start);
|
|
|
|
|
printf("<EFBFBD>յ<EFBFBD>:");
|
|
|
|
|
scanf("%s",airhead->des);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>:");
|
|
|
|
|
scanf("%s",airhead->time);
|
|
|
|
|
printf("<EFBFBD>ܵ<EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
scanf("%d",&airhead->runway);
|
|
|
|
|
printf("״̬:");
|
|
|
|
|
scanf("%s",airhead->airstatus);
|
|
|
|
|
printf("<EFBFBD><EFBFBD>Ʊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
scanf("%d",&airhead->count );
|
|
|
|
|
airend=airhead;
|
|
|
|
|
airend->next=NULL;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
p = (struct airstruct *)malloc(sizeof(struct airstruct));
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뺽<EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
gets(airname);
|
|
|
|
|
if(isexist(airname,3))
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD><EFBFBD>ڣ<EFBFBD>");
|
|
|
|
|
system("pause");
|
|
|
|
|
getchar();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
strcpy(p->airname ,airname);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
scanf("%s",p->start);
|
|
|
|
|
printf("<EFBFBD>յ<EFBFBD>:");
|
|
|
|
|
scanf("%s",p->des);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>:");
|
|
|
|
|
scanf("%s",p->time);
|
|
|
|
|
printf("<EFBFBD>ܵ<EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
scanf("%d",&p->runway);
|
|
|
|
|
printf("״̬:");
|
|
|
|
|
scanf("%s",p->airstatus);
|
|
|
|
|
printf("<EFBFBD><EFBFBD>Ʊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
scanf("%d",&p->count );
|
|
|
|
|
airend->next=p;
|
|
|
|
|
airend = p;
|
|
|
|
|
airend->next = NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
aircount++;
|
|
|
|
|
p = airhead;
|
|
|
|
|
fp = fopen("air", "w");
|
|
|
|
|
while (p != NULL)
|
|
|
|
|
{
|
|
|
|
|
fwrite(p, sizeof(struct airstruct), 1, fp);
|
|
|
|
|
p = p->next;
|
|
|
|
|
}
|
|
|
|
|
fclose(fp);
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӳɹ<EFBFBD>\n");
|
|
|
|
|
printf("3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ع<EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>....\n");
|
|
|
|
|
Sleep(3000);
|
|
|
|
|
}
|
|
|
|
|
void a_rivese1()
|
|
|
|
|
{
|
|
|
|
|
char airname[20];
|
|
|
|
|
char airname1[20];
|
|
|
|
|
struct airstruct *airp;
|
|
|
|
|
int exist=0;
|
|
|
|
|
int end=0;
|
|
|
|
|
char start[20];
|
|
|
|
|
char des[20];
|
|
|
|
|
char time[20];
|
|
|
|
|
char airstatus[20];
|
|
|
|
|
int runway;
|
|
|
|
|
int count;
|
|
|
|
|
airp=airhead;
|
|
|
|
|
system("cls");
|
|
|
|
|
while(airp!=NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("%s ",airp->airname );
|
|
|
|
|
printf("%s ",airp->start );
|
|
|
|
|
printf("%s ",airp->des );
|
|
|
|
|
printf("%s ",airp->time );
|
|
|
|
|
printf("%d ",airp->runway);
|
|
|
|
|
printf("%d ",airp->count );
|
|
|
|
|
printf("%s\n",airp->airstatus );
|
|
|
|
|
airp = airp->next ;
|
|
|
|
|
}
|
|
|
|
|
airp = airhead;
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ĵĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><>@<40>˳<EFBFBD>): ");
|
|
|
|
|
while (gets(airname))
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(airname, "@") == 0)
|
|
|
|
|
break;
|
|
|
|
|
while (airp != NULL)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(airp->airname, airname) == 0)
|
|
|
|
|
{
|
|
|
|
|
exist = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
airp = airp->next;
|
|
|
|
|
}
|
|
|
|
|
if (!exist)
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڸú<EFBFBD><EFBFBD>࣬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
else
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (!exist)
|
|
|
|
|
return;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
int cmd;
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("\n\n\n\n\n\n\n");
|
|
|
|
|
printf("**************************************************************\n");
|
|
|
|
|
printf("1.<2E>ĺ<DEB8><C4BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
printf("2.<2E>ĺ<DEB8><C4BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
printf("3.<2E>ĺ<DEB8><C4BA><EFBFBD><EFBFBD>յ<EFBFBD>\n");
|
|
|
|
|
printf("4.<2E>ij<DEB8><C4B3><EFBFBD>ʱ<EFBFBD><CAB1>\n");
|
|
|
|
|
printf("5.<2E>ĸú<C4B8><C3BA><EFBFBD><EFBFBD>ܵ<EFBFBD><DCB5><EFBFBD>\n");
|
|
|
|
|
printf("6.<2E>ĸú<C4B8><C3BA><EFBFBD><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1>Ŀ\n");
|
|
|
|
|
printf("7.<2E>ĸú<C4B8><C3BA><EFBFBD>״̬\n");
|
|
|
|
|
printf("0.<2E>˳<EFBFBD>\n");
|
|
|
|
|
printf("**************************************************************");
|
|
|
|
|
printf("\n\n\n\n\n\n\n");
|
|
|
|
|
while (1)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>еIJ<EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
scanf("%d", &cmd);
|
|
|
|
|
switch (cmd)
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
{
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
scanf("%s", airname1);
|
|
|
|
|
changeuser(airname,airname1,1);
|
|
|
|
|
strcpy(airp->airname, airname1);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 2:
|
|
|
|
|
{
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
scanf("%s", &start);
|
|
|
|
|
changeuser(airname,start,2);
|
|
|
|
|
strcpy(airp->start, start);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 3:
|
|
|
|
|
{
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD>: ");
|
|
|
|
|
scanf("%s", des);
|
|
|
|
|
changeuser(airname,des,3);
|
|
|
|
|
strcpy(airp->des, des);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 4:
|
|
|
|
|
{
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>: ");
|
|
|
|
|
scanf("%s",time);
|
|
|
|
|
changeuser(airname,time,4);
|
|
|
|
|
strcpy(airp->time, time);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 5:
|
|
|
|
|
{
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD>ܵ<EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
scanf("%d", &runway);
|
|
|
|
|
changeuser1(airname,runway);
|
|
|
|
|
airp->runway = runway;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 6:
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD>Ļ<EFBFBD>Ʊ<EFBFBD><EFBFBD>Ŀ:");
|
|
|
|
|
scanf("%d",&count);
|
|
|
|
|
airp->count =count;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 7:
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD>״̬:");
|
|
|
|
|
scanf("%s", airstatus);
|
|
|
|
|
strcpy(airp->airstatus , airstatus);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 0:
|
|
|
|
|
{
|
|
|
|
|
end = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (end == 1)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
writefile(3);
|
|
|
|
|
}
|
|
|
|
|
void changeuser1(char *s,int a)
|
|
|
|
|
{
|
|
|
|
|
struct userstruct *userp;
|
|
|
|
|
userp = userhead;
|
|
|
|
|
while(userp!=NULL)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
for (i = 0; i < userp->aircount1; i++)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(userp->uairname[i] , s) == 0)
|
|
|
|
|
{
|
|
|
|
|
userp->urunway [i]= a;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
userp = userp->next;
|
|
|
|
|
}
|
|
|
|
|
writefile(0);
|
|
|
|
|
}
|
|
|
|
|
void deleteair()
|
|
|
|
|
{
|
|
|
|
|
struct airstruct *airp;
|
|
|
|
|
char airname[20];
|
|
|
|
|
int exist = 0;
|
|
|
|
|
int end=0;
|
|
|
|
|
airp = airhead;
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫɾ<EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>@<40>˳<EFBFBD>): ");
|
|
|
|
|
while (gets(airname))
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(airname,"@")==0)
|
|
|
|
|
{
|
|
|
|
|
end=1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
while (airp != NULL)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(airname, airp->airname) == 0)
|
|
|
|
|
{
|
|
|
|
|
exist = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
airp = airp->next;
|
|
|
|
|
}
|
|
|
|
|
if (!exist)
|
|
|
|
|
{
|
|
|
|
|
printf("\n\t\t<EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...\n");
|
|
|
|
|
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
printf("\n\t\tɾ<EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>!");
|
|
|
|
|
system("pause");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(end)
|
|
|
|
|
{
|
|
|
|
|
return ;
|
|
|
|
|
}
|
|
|
|
|
deleteuser(airname);
|
|
|
|
|
airp = airhead;
|
|
|
|
|
if (strcmp(airhead->airname,airname) == 0)
|
|
|
|
|
airhead = airhead->next;
|
|
|
|
|
while (airp->next != NULL)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(airp->next->airname, airname) == 0)
|
|
|
|
|
{
|
|
|
|
|
airp->next = airp->next->next;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
airp = airp->next;
|
|
|
|
|
}
|
|
|
|
|
airp = NULL;
|
|
|
|
|
writefile(3);
|
|
|
|
|
/*printf("\n <20><><EFBFBD><EFBFBD>0<EFBFBD><30><EFBFBD>ع<EFBFBD><D8B9><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
int n;
|
|
|
|
|
while (1)
|
|
|
|
|
{
|
|
|
|
|
scanf("%d", &n);
|
|
|
|
|
if (n == 0)
|
|
|
|
|
break;
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
void changeuser(char *s,char *s1,int a)
|
|
|
|
|
{
|
|
|
|
|
struct userstruct *userp;
|
|
|
|
|
userp = userhead;
|
|
|
|
|
switch(a)
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
{
|
|
|
|
|
while (userp != NULL)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
for (i = 0; i < userp->aircount1; i++)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(userp->uairname[i] , s) == 0)
|
|
|
|
|
{
|
|
|
|
|
strcpy(userp->uairname[i] , s1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
userp = userp->next;
|
|
|
|
|
}
|
|
|
|
|
writefile(0);
|
|
|
|
|
}
|
|
|
|
|
case 2:
|
|
|
|
|
{
|
|
|
|
|
while (userp != NULL)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
for (i = 0; i < userp->aircount1; i++)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(userp->ustart[i] , s) == 0)
|
|
|
|
|
{
|
|
|
|
|
strcpy(userp->ustart[i] , s1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
userp = userp->next;
|
|
|
|
|
}
|
|
|
|
|
writefile(0);
|
|
|
|
|
}
|
|
|
|
|
case 3:
|
|
|
|
|
{
|
|
|
|
|
while (userp != NULL)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
for (i = 0; i < userp->aircount1; i++)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(userp->udes[i] , s) == 0)
|
|
|
|
|
{
|
|
|
|
|
strcpy(userp->udes[i] , s1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
userp = userp->next;
|
|
|
|
|
}
|
|
|
|
|
writefile(0);
|
|
|
|
|
}
|
|
|
|
|
case 4:
|
|
|
|
|
{
|
|
|
|
|
while (userp != NULL)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
for (i = 0; i < userp->aircount1; i++)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(userp->utime[i] , s) == 0)
|
|
|
|
|
{
|
|
|
|
|
strcpy(userp->utime[i] , s1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
userp = userp->next;
|
|
|
|
|
}
|
|
|
|
|
writefile(0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
void deleteuser(char *s) //<2F><><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
|
|
|
|
|
{
|
|
|
|
|
struct userstruct *userp;
|
|
|
|
|
int flag = -1;
|
|
|
|
|
userp = userhead;
|
|
|
|
|
while (userp != NULL)
|
|
|
|
|
{
|
|
|
|
|
flag = -1;
|
|
|
|
|
int i;
|
|
|
|
|
for (i = 0; i < userp->aircount1; i++)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(userp->uairname[i] , s) == 0)
|
|
|
|
|
{
|
|
|
|
|
flag = i;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (flag != -1)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
for (i = flag; i < userp->aircount1 - 1; i++)
|
|
|
|
|
{
|
|
|
|
|
strcpy(userp->uairname[i], userp->uairname[i + 1]);
|
|
|
|
|
strcpy(userp->ustart[i], userp->ustart[i + 1]);
|
|
|
|
|
strcpy(userp->udes[i], userp->udes[i + 1]);
|
|
|
|
|
strcpy(userp->utime[i], userp->utime[i + 1]);
|
|
|
|
|
userp->urunway[i]= userp->urunway[i + 1];
|
|
|
|
|
}
|
|
|
|
|
userp->aircount1--;
|
|
|
|
|
}
|
|
|
|
|
userp = userp->next;
|
|
|
|
|
}
|
|
|
|
|
writefile(0);
|
|
|
|
|
}
|
|
|
|
|
void s_add()
|
|
|
|
|
{
|
|
|
|
|
struct adminstruct *p;
|
|
|
|
|
char adminname[20];
|
|
|
|
|
char adminmm[100];
|
|
|
|
|
FILE *fp;
|
|
|
|
|
system("cls");
|
|
|
|
|
if(admincount<=20)
|
|
|
|
|
{
|
|
|
|
|
if(admincount==0)
|
|
|
|
|
{
|
|
|
|
|
printf("\n\n\n\n\n\n\n");
|
|
|
|
|
printf("***************************************************************\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
gets(adminname);
|
|
|
|
|
strcpy(adminhead->adminname, adminname);
|
|
|
|
|
printf("\n\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺");
|
|
|
|
|
gets(adminmm);
|
|
|
|
|
strcpy(adminhead->adminmm,adminmm);
|
|
|
|
|
adminend = adminhead;
|
|
|
|
|
adminend->next = NULL;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
printf("\n\n\n\n\n\n\n");
|
|
|
|
|
printf("***************************************************************\n");
|
|
|
|
|
p=(struct adminstruct *)malloc(sizeof(struct adminstruct));
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
gets(adminname);
|
|
|
|
|
while(1)
|
|
|
|
|
{
|
|
|
|
|
if(isexist(adminname,1))
|
|
|
|
|
{
|
|
|
|
|
printf("\t\t<EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD><EFBFBD>ڣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺");
|
|
|
|
|
gets(adminname);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
strcpy(p->adminname, adminname);
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺");
|
|
|
|
|
gets(adminmm);
|
|
|
|
|
strcpy(p->adminmm, adminmm);
|
|
|
|
|
adminend->next = p;
|
|
|
|
|
adminend = p;
|
|
|
|
|
adminend->next = NULL;
|
|
|
|
|
}
|
|
|
|
|
admincount++;
|
|
|
|
|
fp = fopen("admin", "w");
|
|
|
|
|
p = adminhead;
|
|
|
|
|
while (p != NULL)
|
|
|
|
|
{
|
|
|
|
|
fwrite(p, sizeof(struct adminstruct), 1, fp);
|
|
|
|
|
p = p->next;
|
|
|
|
|
}
|
|
|
|
|
fclose(fp);
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա%s<><73><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>\n", adminend->adminname);
|
|
|
|
|
printf("3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>½<EFBFBD><EFBFBD><EFBFBD><EFBFBD>....\n");
|
|
|
|
|
Sleep(3000);
|
|
|
|
|
adminlogin();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
system("pause");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>....");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void s_delete()
|
|
|
|
|
{
|
|
|
|
|
struct adminstruct *adminp;
|
|
|
|
|
char adminname[20];
|
|
|
|
|
int exist = 0;
|
|
|
|
|
int end=0;
|
|
|
|
|
adminp = adminhead;
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫɾ<EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>(<28><>@<40>˳<EFBFBD>): ");
|
|
|
|
|
while (gets(adminname))
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(adminname,"@")==0)
|
|
|
|
|
{
|
|
|
|
|
end=1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
while (adminp != NULL)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(adminname, adminp->adminname) == 0)
|
|
|
|
|
{
|
|
|
|
|
exist = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
adminp = adminp->next;
|
|
|
|
|
}
|
|
|
|
|
if (!exist)
|
|
|
|
|
{
|
|
|
|
|
printf("\t\t<EFBFBD>ù<EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!..\n");
|
|
|
|
|
printf("\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
adminp = adminhead;
|
|
|
|
|
if (strcmp(adminhead->adminname,adminname) == 0)
|
|
|
|
|
adminhead = adminhead->next;
|
|
|
|
|
while (adminp->next != NULL)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp(adminp->next->adminname, adminname) == 0)
|
|
|
|
|
{
|
|
|
|
|
adminp->next = adminp->next->next;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
adminp = adminp->next;
|
|
|
|
|
}
|
|
|
|
|
adminp = NULL;
|
|
|
|
|
}
|
|
|
|
|
void zhuce()
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
int end=0;
|
|
|
|
|
while(1)
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
|
|
|
|
|
SetConsoleTextAttribute(handle, FOREGROUND_INTENSITY | FOREGROUND_RED);
|
|
|
|
|
printf("\n\n\n\n\n\n");
|
|
|
|
|
printf(" 1 <20>û<EFBFBD>ע<EFBFBD><D7A2>\n");
|
|
|
|
|
printf(" 2 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Աע<D4B1><D7A2>\n");
|
|
|
|
|
printf(" 0 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>\n");
|
|
|
|
|
printf("\n\n\n");
|
|
|
|
|
printf(" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD>еIJ<D0B5><C4B2><EFBFBD><EFBFBD><EFBFBD> ");
|
|
|
|
|
scanf("%d",&i);
|
|
|
|
|
getchar();
|
|
|
|
|
switch(i)
|
|
|
|
|
{
|
|
|
|
|
case 1:userrigester();break;
|
|
|
|
|
case 2:superrigerster();break;
|
|
|
|
|
case 0:end=1;break;
|
|
|
|
|
default:printf(" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!<21><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺");
|
|
|
|
|
system("pause"); //<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB> <20>밴<EFBFBD><EBB0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if(end==1)
|
|
|
|
|
break; //<2F>˳<EFBFBD>ѭ<EFBFBD><D1AD>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void userrigester() //<2F>ο<EFBFBD>1402
|
|
|
|
|
{
|
|
|
|
|
struct userstruct *p;
|
|
|
|
|
char username[20];
|
|
|
|
|
char usermm[100];
|
|
|
|
|
char name[10];
|
|
|
|
|
char sex[10];
|
|
|
|
|
char tele[20];
|
|
|
|
|
char id[20];
|
|
|
|
|
FILE *fp;
|
|
|
|
|
system("cls");
|
|
|
|
|
if (usercount == 0) //<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
userhead = (struct userstruct *)malloc(sizeof(struct userstruct));
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
gets(username);
|
|
|
|
|
strcpy(userhead->username, username);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
gets(usermm);
|
|
|
|
|
strcpy(userhead->usermm, usermm);
|
|
|
|
|
userhead->aircount1 = 0;
|
|
|
|
|
userend = userhead;
|
|
|
|
|
userend->next = NULL;
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
gets(name);
|
|
|
|
|
strcpy(userhead->name ,name);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
gets(sex);
|
|
|
|
|
strcpy(userhead->sex ,sex);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>ĵ绰<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
gets(tele);
|
|
|
|
|
strcpy(userhead->tele ,tele);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>):");
|
|
|
|
|
gets(id);
|
|
|
|
|
strcpy(userhead->id ,id);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
p = (struct userstruct *)malloc(sizeof(struct userstruct));
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
gets(username);
|
|
|
|
|
while(1)
|
|
|
|
|
{
|
|
|
|
|
if (isexist(username, 0))
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
gets(username);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
strcpy(p->username, username);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
gets(usermm);
|
|
|
|
|
strcpy(p->usermm, usermm);
|
|
|
|
|
p->aircount1 = 0;
|
|
|
|
|
userend->next = p;
|
|
|
|
|
userend = p;
|
|
|
|
|
userend->next = NULL;
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
gets(name);
|
|
|
|
|
strcpy(p->name ,name);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
gets(sex);
|
|
|
|
|
strcpy(p->sex ,sex);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>ĵ绰<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
gets(tele);
|
|
|
|
|
strcpy(p->tele ,tele);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>):");
|
|
|
|
|
gets(id);
|
|
|
|
|
strcpy(p->id ,id);
|
|
|
|
|
}
|
|
|
|
|
usercount++;
|
|
|
|
|
fp = fopen("user", "w");
|
|
|
|
|
p = userhead;
|
|
|
|
|
while (p != NULL)
|
|
|
|
|
{
|
|
|
|
|
fwrite(p, sizeof(struct userstruct), 1, fp);
|
|
|
|
|
p = p->next;
|
|
|
|
|
}
|
|
|
|
|
fclose(fp);
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("<EFBFBD>û<EFBFBD>%s<><73><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>\n", userend->username);
|
|
|
|
|
printf("3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>½<EFBFBD><EFBFBD><EFBFBD><EFBFBD>....\n");
|
|
|
|
|
Sleep(3000);
|
|
|
|
|
dengru();
|
|
|
|
|
}
|
|
|
|
|
void superrigerster()
|
|
|
|
|
{
|
|
|
|
|
struct superstruct *p;
|
|
|
|
|
char supername[20];
|
|
|
|
|
char supermm[100];
|
|
|
|
|
FILE *fp;
|
|
|
|
|
int i;
|
|
|
|
|
system("cls");
|
|
|
|
|
char str[100];
|
|
|
|
|
char mm[]="pangshou180125"; //<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>
|
|
|
|
|
int j;
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:");
|
|
|
|
|
for(j=0;j<100;j++)
|
|
|
|
|
{
|
|
|
|
|
str[j]=getch();
|
|
|
|
|
if(str[j]!=13&&str[j]!=8)
|
|
|
|
|
{
|
|
|
|
|
printf("*");
|
|
|
|
|
}
|
|
|
|
|
if(str[j]==8)
|
|
|
|
|
{
|
|
|
|
|
printf("\b");
|
|
|
|
|
j--;
|
|
|
|
|
printf(" ");
|
|
|
|
|
printf("\b");
|
|
|
|
|
j--;
|
|
|
|
|
}
|
|
|
|
|
if(str[j]==13)
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
str[j]='\0';
|
|
|
|
|
if(strcmp(mm,str)==0)
|
|
|
|
|
{
|
|
|
|
|
if(supercount<=5) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܶ<EFBFBD><DCB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
if(supercount==0)
|
|
|
|
|
{
|
|
|
|
|
superhead = (struct superstruct *)malloc(sizeof(struct superstruct));
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
fflush(stdin); //<2F><><EFBFBD>ջ<EFBFBD><D5BB><EFBFBD>
|
|
|
|
|
gets(supername);
|
|
|
|
|
strcpy(superhead->supername,supername);
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺");
|
|
|
|
|
fflush(stdin); //<2F><><EFBFBD>ջ<EFBFBD><D5BB><EFBFBD>
|
|
|
|
|
gets(supermm);
|
|
|
|
|
strcpy(superhead->supermm ,supermm);
|
|
|
|
|
superend=superhead;
|
|
|
|
|
superend->next = NULL;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
p = (struct superstruct *)malloc(sizeof(struct superstruct));
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
gets(supername);
|
|
|
|
|
strcpy(superhead->supername,supername);
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺");
|
|
|
|
|
gets(supermm);
|
|
|
|
|
strcpy(superhead->supermm ,supermm);
|
|
|
|
|
superend->next = p;
|
|
|
|
|
superend=p;
|
|
|
|
|
superend->next =NULL;
|
|
|
|
|
}
|
|
|
|
|
supercount++;
|
|
|
|
|
fp = fopen("super", "w"); //д<><D0B4><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
p = superhead;
|
|
|
|
|
while (p != NULL)
|
|
|
|
|
{
|
|
|
|
|
fwrite(p, sizeof(struct superstruct), 1, fp); //<2F><>p<EFBFBD><70>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>д<EFBFBD><D0B4>fpָ<70><D6B8><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>super<65><72>
|
|
|
|
|
p = p->next;
|
|
|
|
|
}
|
|
|
|
|
fclose(fp);
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա%s<><73><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>\n", superend->supername);
|
|
|
|
|
printf("3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>½<EFBFBD><EFBFBD><EFBFBD><EFBFBD>....\n");
|
|
|
|
|
Sleep(3000); //windows<77>º<EFBFBD><C2BA><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ3<CDA3><33>ʱ<EFBFBD><CAB1>
|
|
|
|
|
dengru();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD>\n");
|
|
|
|
|
printf("1 <20>˳<EFBFBD>\n2 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>\n");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD>:");
|
|
|
|
|
scanf("%d",&i);
|
|
|
|
|
if(i==1)
|
|
|
|
|
{
|
|
|
|
|
home();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void superfile()
|
|
|
|
|
{
|
|
|
|
|
struct superstruct *p;
|
|
|
|
|
FILE *fp;
|
|
|
|
|
p = superhead;
|
|
|
|
|
fp = fopen("super", "ab+");
|
|
|
|
|
while (fread(p, sizeof(struct superstruct), 1, fp))
|
|
|
|
|
{
|
|
|
|
|
if (p->next != NULL)
|
|
|
|
|
{
|
|
|
|
|
p = (struct superstruct *)malloc(sizeof(struct superstruct));
|
|
|
|
|
superend->next = p;
|
|
|
|
|
superend = p;
|
|
|
|
|
superend->next = NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void airfile()
|
|
|
|
|
{
|
|
|
|
|
struct airstruct *p;
|
|
|
|
|
FILE *fp;
|
|
|
|
|
p = airhead;
|
|
|
|
|
fp = fopen("air", "ab+");
|
|
|
|
|
while (fread(p, sizeof(struct airstruct), 1, fp))
|
|
|
|
|
{
|
|
|
|
|
if (p->next != NULL)
|
|
|
|
|
{
|
|
|
|
|
p = (struct airstruct *)malloc(sizeof(struct airstruct));
|
|
|
|
|
airend->next = p;
|
|
|
|
|
airend = p;
|
|
|
|
|
airend->next = NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void userfile()//ͬ<><CDAC>
|
|
|
|
|
{
|
|
|
|
|
struct userstruct *p;
|
|
|
|
|
FILE *fp;
|
|
|
|
|
p = userhead;
|
|
|
|
|
fp = fopen("user", "ab+");
|
|
|
|
|
while (fread(p,sizeof(struct userstruct),1,fp))
|
|
|
|
|
{
|
|
|
|
|
if (p->next != NULL)
|
|
|
|
|
{
|
|
|
|
|
p = (struct userstruct *)malloc(sizeof(struct userstruct));
|
|
|
|
|
userend->next = p;
|
|
|
|
|
userend = p;
|
|
|
|
|
userend->next = NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void adminfile() //<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD> ,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
struct adminstruct *p;
|
|
|
|
|
FILE *fp;
|
|
|
|
|
p = adminhead;
|
|
|
|
|
fp = fopen("admin", "ab+");
|
|
|
|
|
while (fread(p, sizeof(struct adminstruct), 1, fp))
|
|
|
|
|
{
|
|
|
|
|
if (p->next != NULL)
|
|
|
|
|
{
|
|
|
|
|
p = (struct adminstruct *)malloc(sizeof(struct adminstruct)); //Ϊ<><CEAA><EFBFBD><EFBFBD><EFBFBD>Ľ<EFBFBD><C4BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>
|
|
|
|
|
adminend->next = p;
|
|
|
|
|
adminend = p;
|
|
|
|
|
adminend->next = NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void writefile(int flag) //'д<>ļ<EFBFBD>',<2C><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
FILE *fp;
|
|
|
|
|
struct userstruct *userp;
|
|
|
|
|
struct adminstruct *adminp;
|
|
|
|
|
struct superstruct *superp;
|
|
|
|
|
struct airstruct *airp;
|
|
|
|
|
userp = userhead;
|
|
|
|
|
adminp = adminhead;
|
|
|
|
|
superp = superhead;
|
|
|
|
|
airp = airhead;
|
|
|
|
|
if (flag == 0)
|
|
|
|
|
{
|
|
|
|
|
fp = fopen("user", "w");
|
|
|
|
|
while (userp != NULL)
|
|
|
|
|
{
|
|
|
|
|
fwrite(userp, sizeof(struct userstruct), 1, fp);
|
|
|
|
|
userp = userp->next;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (flag == 1)
|
|
|
|
|
{
|
|
|
|
|
fp = fopen("admin", "w");
|
|
|
|
|
|
|
|
|
|
while (adminp != NULL)
|
|
|
|
|
{
|
|
|
|
|
fwrite(adminp, sizeof(struct adminstruct), 1, fp);
|
|
|
|
|
adminp = adminp->next;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(flag==2)
|
|
|
|
|
{
|
|
|
|
|
fp = fopen("super", "w");
|
|
|
|
|
while (superp != NULL)
|
|
|
|
|
{
|
|
|
|
|
fwrite(superp, sizeof(struct superstruct), 1, fp);
|
|
|
|
|
superp = superp->next;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(flag==3)
|
|
|
|
|
{
|
|
|
|
|
fp = fopen("air","w");
|
|
|
|
|
while(airp!=NULL)
|
|
|
|
|
{
|
|
|
|
|
fwrite(airp, sizeof(struct airstruct), 1, fp);
|
|
|
|
|
airp = airp->next ;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
fclose(fp);
|
|
|
|
|
}
|