想请大家帮我看看我的程序为什错了
#include<stdio.h>#include<stdlib.h>
#include<string.h>
#define maxsize 4
#define ok 1
#define error 0
typedef struct HXnode {
char air_num[10];
char Feijihao[10];
char date[10];
char end_place[10];
int total;
int left;
struct HXnode *next;
}HXGLnode;
typedef struct KHnode{
char name;
char air_num[10];
int seat_num;
struct KHnode*next;
} KHnode;
HXnode *head_HX();
KHnode *head_KH();
int CreatHX(HXnode **l);
int CreatKH(KHnode **l);
int insertHX(HXnode**p,char*air_num,char *Feijihao,char *date,char *end_place,int total,int left);
int insertKH(KHnode **p,char *name,int seat_num,char air_num);
HXnode *modefy_airline(HXnode *l,char *air_num);
int DP(HX *a,char*air_num,KHnode *c,char *name,int seat_num)
int QXDP(KHnode *c,KHnode *L,char *name,int seat_num);
int CXHX(HXnode *head);
int CXKH(KHnode *head);
void main()
{
int p=2;
KHnode *cus=head_KH();
HXnode *air=head_HX();
char name[20],air_num[20],mima[20],ch;
char t[20]="liuyu";
clrscr();
creatHXGL(&air);
creatKH(&cus);
while(p==2)
{
printf("\n welcome to the airline system !\n\n please choose:\n\n ");
printf("*******************************\n\n");
printf(" 1.DP \n");
printf(" 2.QXDP \n");
printf(" 3.CX \n");
printf(" 4.EXIT \n\n");
printf("*********************\n\n");
switch(ch=getch())
{
case'1':{printf("\n********DP*****\n");
printf("please intput a airline num:");
scanf("%s",&air_num);
printf("please intput your name:");
scanf("%s",&name);
DP(air,air_num,cus,name);getch();};break;
case'2':{printf("\n********QXDP*****\n");
printf("please intput name:");
scanf("%s",name);
QXDP(cus,air,name);}:break;
case'3':{printf("\n********CX*****\n");
printf("1.CXHXIAN\n");
printf("2.CXKH\n");
printf(" other exit\n");
printf("*************\n");
if((ch=getch())=='1')
{
ptintf("********CXHANGXIAN***********\n");
CXHX(air);}
else if(ch=='2')
{
printf("\n please intput the key:");
scanf("%s",mima);
if(strcmp(mima,t)==0)
{ printf("\n*******CXKH*******");
CXKH(cus);}
else printf("sorry,the key is wrong");getch();}}break;
case'4':{getch();
p=0;}
break;}}}
HXnode *head_HX()
HXnode *a;
a=(HXnode *)malloc(sizeof(HXnode));
if(a==NULL)
a->next=NULL;
return a;}
KHnode *head_KH()
{
KHnode *c;
c=(KHnode *)malloc(sizeof(KHnode));
if(c==NULL)
c->next=NULL;
return c;}
int CreatHX(HXnode **l)
{HXnode *P=*l;
int i=0;
char*air_num[3]={"A111","B222","C333"} ;
char *Feijihao[3]={"1021","1022","1023"};
char *date[3]={"mon","mon","mon"};
char *end_place={"tianjin","xiamen","dalian"};
int total={50,50,50};
int left={2,2,2};
for(i=0;i<3;i++)
insertHX(&p,air_num[i],date[i],end_place[i],total[i],left[i]);
return ok;}
int CreatKH(KHnode **l)
KHnode *P=*l;
int i=0;
char *name[3]={"lili","liuli","wanli"};
char * air_num={"A1021","A1022","A1023"};
int seat_num[3]={2,1,1};
for(i=0;i<3;i++)
insertHK(&p,name[i],air_num[i],seat_num[i]);
return ok;}
int insertHX(HXnode **p,char*air_num,char *Feijihao,char *date,char *end_place,int total,int left)
HXnode *q;
q=(HXnode *)malloc(sizeof(HXnode));
strcpy(q->air_num,air_num);
strcpy(q->Feijihao,Feijihao);
strcpy(q->date,date);
strcpy(q->end_place,end_place);
q->total=total;
q->left=left;
q->next=NULL;
(*p)->next=q;
(*p)=(*p)->next;
return ok;}
int insertKH(KHnode **p,char *name,int seat_num)
KHnode *q;
q=(KHnode *)malloc(sizeof(KHnode));
strcpy(q->name,name);
q->seat_num;
q->next=NULL;
(*P)->next=q;
(*p)=(*p)->next;
return ok;}
HXnode *modefy_airline(HXnode *l,char *air_num)
{ HXnode *p;
p=l->next;
for(;p!=NULL;p=p->next)
{
if(strcmp(air_num,p->air_num)==0)
{ p->left++;
return 1;}
printf("no the airline!");
return 0;}}
int DP(HXnode *a,char *air_num,KHnode *c,char *name,int seat_num)
{
HXnode *p=a;
KHnode *q=c->next;
p=a->next;
for(;q->next!=NULL;q=q->next) ;
for(;p!=NULL;p=p->next)
{
if(strcmp(p->air_num,air_num)==0){
if(p->left>0)
{ printf("\nCHENG GONG DING PIAO\n\n name:\n seat_num:\n ");
printf("\n***********");
intsertKH(&q,name,air_num,p->total-p>left+1);
p->left--;return ok;}
else
{ printf("seat is full");
return 0;}}
printf("\n");}
int QXDP(KHnode *c,HXnode *l,char *name)
{
KHnode *p,*pr;
char air_num[20];
pr=c;
p=pr->next;
while(p!=NULL)
{if (strcmp(p->name,name)==0)
{ strcmp(air_num,p->air_num);
l=modefy_airline(l,air_num);
pr->next=p->next;
p=pr->next;
printf("TUI PIAO CHENG GONG\n");
return ok;}pr=pr->next;
p=pr->next;}
printf("CUO WU\n ");
return error;}
int CXHX(HXnode *head)
{HXnode *p=head->next;
printf("air_num Feijihao date end_place total left\n\n");
for(;p!=NULL;p=p->next)
{ printf("%s","%10s","%9s\n",p->air_num,p->end_place,p->left);
printf("\n");
return ok;}
int CXKH(KHnode *head)
{ struct KHnode *q=head->next;
printf("name air_num\n\n");
for(;q!=NULL;q=q->next)
{printf("%s %s\n",q->nqme,q->num);
printf("\n");}
printf("\n***************");
return ok;}