printf(\起飞时间:%s\\n\ printf(\到达时间:%s\\n\ printf(\票价:%s\\n\
printf(\飞机型号:%s\\n\ break; } else p=p->next; }
if(p==NULL) }
printf(\查无此航班\\n\
/*到达时间查找*/ void finde(NOD *head) { NOD *p;
char arrivingtime[10];
printf(\请输入查找航班的到达时间:\ scanf(\ p=head;
while (p!=NULL)
{ if(strcmp(arrivingtime,p->arrivingtime)==0) { printf(\航班号:%s\\n\ printf(\起点站:%s\\n\ printf(\终点站:%s\\n\ printf(\班期:%s\\n\
printf(\起飞时间:%s\\n\ printf(\到达时间:%s\\n\ printf(\票价:%s\\n\
printf(\飞机型号:%s\\n\ break; } else p=p->next; }
if(p==NULL)
printf(\查无此航班\\n\ }
/*删除*/
NOD *dele(NOD *head) { NOD *p,*q;
char number[5];
printf(\请输入要删除的航班编号\ scanf(\ p=q=head;
while(p!=NULL)
{ if(strcmp(number,p->number)==0) { if(head==p) head=p->next; else q->next=p->next; free(p); break; } else {q=p;
p=p->next; } }
if(p==NULL)printf(\查无此航班\\n\ return head; }
/*主函数*/ void main() { NOD *head; char fnum[10]; int choise;
printf(\欢迎光临航班查询系统:\ scanf(\ head=load(fnum); while(1)
{ printf(\ 航班信息检索与查询\\n\
printf(\ printf(\航班号查找\\n\ printf(\起点站查找\\n\ printf(\终点站查找\\n\ printf(\起飞时间查找\\n\ printf(\到达时间查找\\n\ printf(\航班号删除\\n\ printf(\增加新航班\\n\ printf(\显示所有航班\\n\ printf(\存盘并退出\\n\ printf(\请选择1-9:\ scanf(\ switch(choise)
{ case 1:finda(head);break; case 2:findb(head);break;
case 3:findc(head);break; case 4:findd(head);break; case 5:finde(head);break;
case 6:head=dele(head);break; case 7:head=insert(head);break; case 8:display(head);break; case 9:save(head,fnum); exit(0); default:printf(\输入错误,重新输入\\n\ } } }
航班查询系统 C语言源程序
![](/skin/haowen/images/icon_star.png)
![](/skin/haowen/images/icon_star.png)
![](/skin/haowen/images/icon_star.png)
![](/skin/haowen/images/icon_star.png)