资源描述:
《信息111班 赵朋.doc》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、航空订票系统源代码班级:信息111姓名:赵朋学号:3110702132#include#include#include#include#definePS&(p->number),p->time_go,p->time_to,p->place_go,p->place_to,&(p->price),&(p->discount),&(p->seat_total),&(p->seat_odd)#definePPp->number,p->time_go,p->time_to,p->place_go,p->p
2、lace_to,p->price,p->discount,p->seat_total,p->seat_odd#defineCSp->name,&(p->numb_id),&(p->amount_t),&(p->numb_p)structplane_inf{intnumber;chartime_go[16];chartime_to[16];charplace_go[20];charplace_to[20];intprice;floatdiscount;intseat_total;intseat_odd;structplane_inf*next;};/*航班信息*/stru
3、ctcust_inf{charname[20];intnumb_id;intamount_t;intnumb_p;intnumb_ord;structcust_inf*next;};/*顾客信息*/typedefstructplane_infp_inf;typedefstructcust_infc_inf;voidluru();voidxiugai();voidchaxun();voiddingpiao();voidtuipiao();intxg_hb(intnumber,intamount_t,p_inf*p);p_inf*read_p();c_inf*read_c(
4、);voidwrite_p(p_inf*);voidwrite_c(c_inf*);voidfree_p(p_inf*);voidfree_c(c_inf*);intmain(){intchoice;inti=0;do{printf("tt$***************航空订票系统***************$");printf("ttt1.录入航班信息");printf("ttt2.修改航班信息");printf("ttt3.查询航班信息");printf("ttt4.顾客订票");printf("t
5、tt5.顾客退票");printf("ttt6.退出");printf("tt$******************************************$");printf("请输入你的选择[]bb");scanf("%d",&choice);//system("cls");/*该句作用是刷屏*/switch(choice){case1:luru();break;case2:xiugai();break;case3:chaxun();break;case4:dingpiao();break;case5:tuipiao();
6、break;case6:exit(0);default:printf("您的输入有误,请重新选择:");}}while(choice!=0);}voidluru()//录入航班信息{charchoice;p_inf*p;FILE*fp;if((fp=fopen("d:\plane.dat","ab"))==NULL){fp=fopen("d:\plane.dat","wb");}else;do{printf("请输入航班信息,各项内容之间以空格键或Tab键分开:");printf("航班号起飞时间抵达时间始发地目的地票价折扣情况座位总数剩余票
7、数");p=(p_inf*)malloc(sizeof(p_inf));p->discount=10.0;p->next=NULL;fflush(stdin);scanf("%d%s%s%s%s%d%f%d%d",PS);fwrite(p,sizeof(p_inf),1,fp);printf("******************************************************************************");printf("继续录入按Y,输入其他字符则返回上一级菜单")