




如果您无法下载资料,请参考说明:
1、部分资料下载需要金币,请确保您的账户上有足够的金币
2、已购买过的文档,再次下载不重复扣费
3、资料包下载后请先用软件解压,在使用对应软件打开
一个简单的火车票售票管理系统(大全五篇) 第一篇:一个简单的火车票售票管理系统一个简单的火车票售票管理系统(原创)#include#include#defineMAX100#defineN50typedefstructtime//时间类型{intx,y,z;//分别对应年,月,日}TIME;typedefstructcnode//票信息类型{intno;//票号intid;//购票人证件号TIMEdate;//购票日期structcnode*next;}CNODE;typedefstructtnode//车次信息类型{chardata;//车次编号structtnode*lchild,*rchild;CNODE*head;}TNODE;voidcreate();//按车次建立二叉排序树voidinsert(int);//增加新的车次(二叉排序树的插入)voiddel();//取消车次(二叉排序树节点删除)voidinorder(TNODE*);//中序遍历车次二叉排序树(仅显示车次信息)voidinorder_all(TNODE*);//中序遍历车次二叉排序树(显示车次及售票信息)voidpreorder(TNODE*);//先序遍历车次二叉排序树(仅显示车次信息)TNODE*search();//按车次编号搜索CNODE*insert_c(CNODE*);//插入新的售票信息(单张)CNODE*insert_c_more(CNODE*);//插入新的售票信息(批量)CNODE*del_c(CNODE*,CNODE*);//退票处理(删除售票信息)CNODE*search_c(CNODE*,int);//按票号查询voidsearch_c_id(CNODE*,int);//按购票人证件号搜索(限定某车次)voidsearch_c_id_all(TNODE*,int);//按购票人证件号搜索(所有车次)voidsearch_date(CNODE*,TIME);//按购票日期搜索(限定某车次)voidsearch_date_all(TNODE*,TIME);//按购票日期搜索(所有车次)voidprint_c(CNODE*);//输出售票纪录(单张)voidprint_c_all(CNODE*);//输出售票纪录(批量)TNODE*root=NULL;voidmain(){inti,func,no,ok;TNODE*t;CNODE*c;TIMEd;printf(“nnn”);for(i=0;iprintf(“列车售票信息管理系统”);for(i=0;iprintf(“n”);printf(“t1.车次信息管理n”);printf(“t2.售票记录管理n”);printf(“t3.售票记录查询n”);printf(“t4.售票记录一览n”);printf(“t5.退出系统n”);for(i=0;iprintf(“n请选择您所需要的功能:”);fflush(stdin);scanf(“%d”,&func);switch(func){case1:printf(“nn车次信息管理>>>>n”);for(i=0;iprintf(“nt1.增加新的车次”);printf(“nt2.取消车次”);printf(“nt3.返回上级菜单n”);for(i=0;iprintf(“n请选择您所需要的功能:”);fflush(stdin);scanf(“%d”,&func);switch(func){case1:create();printf(“n售票信息更新成功!nn”);break;case2:del();break;case3:main();break;default:printf(“n[错误]功能号输入有误!请重新输入!”);}break;case2:printf(“nn售票记录管理>>>>n”);for(i=0;iprintf(“nt1.增加新的售票记录”);printf(“nt2.退票”);printf(“nt3.返回上级菜单n”);for(i=0;iprintf(“n请选择您所需要的功能:”);fflush(stdin);scanf(“%d”,&func);switch(func){case1:t=search();if(t!=NULL)t->head=insert_c_more(t->head);break;case2:t=search();printf(“需要退票的票号:”);scanf(“%d”,&no);t->head=del_c(t->head,search_c(t->head,no));break;case3:main();break;default:printf(“n[错误]功能号输入有误!请重新输入!”);}break;c

佳晨****ng
实名认证
内容提供者


最近下载