(汽车行业)汽车管理

上传人:管****问 文档编号:127845448 上传时间:2020-04-06 格式:DOC 页数:6 大小:43.57KB
返回 下载 相关 举报
(汽车行业)汽车管理_第1页
第1页 / 共6页
(汽车行业)汽车管理_第2页
第2页 / 共6页
(汽车行业)汽车管理_第3页
第3页 / 共6页
(汽车行业)汽车管理_第4页
第4页 / 共6页
(汽车行业)汽车管理_第5页
第5页 / 共6页
点击查看更多>>
资源描述

《(汽车行业)汽车管理》由会员分享,可在线阅读,更多相关《(汽车行业)汽车管理(6页珍藏版)》请在金锄头文库上搜索。

1、#include#include#include#define tcs 2 /停车场内最多停车数#define price 0.02/停车内停车的单价(每分钟)typedef struct tsint tx;/停车的时刻 小时int tf;/停车的时刻 分钟ts1;typedef struct cj char num10;/车牌照 ts1 d; ts1 l;cn;typedef struct Cjcn *stacktcs+1; int top;Car;typedef struct carcn *data; struct car *next;QueueNode;typedef struct No

2、deQueueNode *head; QueueNode *rear;LCar;void Tc(Car *); void Bd(LCar *);void D(Car *,LCar *); void L(Car *,Car *,LCar *);void Lb(Car,LCar); void Sc(cn *c,int cw) /输出信息 int d1,d2,l1,l2; printf(n车辆离开的时间:); scanf(%d:%d,&(c-l.tx),&(c-l.tf); printf(n离开车辆的车牌号为:); puts(c-num); printf(n其到达时间为: %d:%d,c-d.tx,

3、c-d.tf); printf(离开时间为: %d:%d,c-l.tx,c-l.tf); d1=c-d.tx; d2=c-d.tf; l1=c-l.tx; l2=c-l.tf; printf(n应交费用为: %2.1f元,(l1-d1)*60+(l2-d2)*price); free(c);void D(Car *Enter,LCar *W) cn *p; QueueNode *t; p=(cn *)malloc(sizeof(cn); flushall();printf(n请输入车牌号(例:辽A1234):n); gets(p-num); if(Enter-toptop+;printf(n车

4、辆在车场第%d位置.,Enter-top); printf(n车辆到达时间:整时=24, 分钟d.tx),&(p-d.tf); Enter-stackEnter-top=p; else printf(n该车须在便道等待!有车位时进入车场n); t=(QueueNode *)malloc(sizeof(QueueNode); t-data=p; t-next=NULL; W-rear-next=t; W-rear=t; void L(Car *Enter,Car *Temp,LCar *W) int cw; cn *p,*t; QueueNode *q; if(Enter-top0) while

5、(1) printf(n请输入车在车场的位置/1-%d/:,Enter-top); scanf(%d,&cw); if(cw=1&cwtop) break;while(Enter-topcw) Temp-top+;Temp-stackTemp-top=Enter-stackEnter-top; Enter-stackEnter-top=NULL; Enter-top-; p=Enter-stackEnter-top; Enter-stackEnter-top=NULL; Enter-top-;while(Temp-top=1) Enter-top+;Enter-stackEnter-top=T

6、emp-stackTemp-top; Temp-stackTemp-top=NULL; Temp-top-;Sc(p,cw);if(W-head!=W-rear)&Enter-tophead-next; t=q-data; Enter-top+;printf(n便道的%s号车进入车场第%d位置.,t-num,Enter-top); printf(n请输入%s号车进入车场的时间:);scanf(%d:%d,&(t-d.tx),&(t-d.tf); W-head-next=q-next; if(q=W-rear) W-rear=W-head; Enter-stackEnter-top=t; fre

7、e(q);else printf(n便道里没有车.n);else printf(n车场里没有车.); void Lb1(Car *S) int i;if(S-top0)printf(n车场:);printf(n 位置到达时间 车牌号n);for(i=1;itop;i+)printf( %d ,i);printf( %d:%d ,S-stacki-d.tx,S-stacki-d.tf);puts(S-stacki-num);else printf(n车场里没有车);void Lb2(LCar *W) QueueNode *p;p=W-head-next;if(W-head!=W-rear)pri

8、ntf(n等待车辆的号码为:);while(p!=NULL)puts(p-data-num);p=p-next;else printf(n便道里没有车.);void Lb(Car S,LCar W)int flag,tag;flag=1; while(flag)printf(n请选择 1|2|3:n);printf(n 1.车场列表n 2.便道列表n 3.返回主菜单n);while(1) scanf(%d,&tag);if(tag=1|tag=1&chtop=0; for(i=0;istacks-top=NULL;void Bd(LCar *Q)Q-head=(QueueNode *)malloc(sizeof(QueueNode); if(Q-head!=NULL) Q-head-next=NULL; Q-rear=Q-head;

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 商业/管理/HR > 经营企划

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号