停车场管理系统源代码.docx
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_05.gif)
《停车场管理系统源代码.docx》由会员分享,可在线阅读,更多相关《停车场管理系统源代码.docx(15页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、停车场管理系统源代码/停车场管理系统#include#include#defineOVERFLOW0#defineERROR0#defineOK1#defineSTACKSIZE2/车库容量/时间节点typedefstructtimeinthour;intmin;Time;/车辆信息typedefstructcharCarNum;floattime;intpos_a;/车在停车场中的位置intpos_b;/车在便道上的位置intflag;Car,Car2;/车库信息顺序栈typedefstructCar*top;Car*base;intstacksize;SqStack;/初始化intInit
2、Stack(SqStack&S)S.base=newCarSTACKSIZE;if(!S.base)exit(OVERFLOW);S.top=S.base;S.stacksize=STACKSIZE;returnOK;/判空intStackEmpty(SqStackS)if(S.top=S.base)returnOK;elsereturnERROR;/判满intStackFull(SqStackS)if(S.top-S.base=S.stacksize)returnOK;elsereturnERROR;/入栈intPush(SqStack&S,Care)if(S.top-S.base=S.st
3、acksize)returnERROR;*S.top+=e;returnOK;/出栈intPop(SqStack&S,Car&e)if(S.top=S.base)returnERROR;e=*-S.top;returnOK;/遍历栈intStackTraverse(SqStackS)Car*p=S.top;Car*q=S.base;intl=1;if(StackEmpty(S)for(intj=1;jq+;returnOK;/备用车道顺序栈typedefstructCar2*top2;Car2*base2;/intstacksize2;SqStack2;/初始化intInitStack2(Sq
4、Stack2&S2)S2.base2=newCar2STACKSIZE;if(!S2.top2)exit(OVERFLOW);/S2.top2=S2.base2;S2.stacksize2=STACKSIZE;returnOK;/判空intStackEmpty2(SqStack2S2)if(S2.top2=S2.base2)returnOK;elsereturnERROR;/进栈intPush2(SqStack2&S2,Car2e2)if(S2.top2-S2.base2=STACKSIZE)returnERROR;*S2.top2+=e2;returnOK;/出栈intPop2(SqStac
5、k2&S2,Car2&e2)if(S2.top2=S2.base2)returnERROR;e2=*-S2.top2;returnOK;/车道信息链队typedefstructQNodeCardata;structQNode*next;QNode,*QueuePtr;typedefstructQueuePtrfront;QueuePtrrear;LinkQueue;/初始化intInitQueue(LinkQueue&Q)Q.front=Q.rear=newQNode;Q.front-next=NULL;returnOK;/进队intEnQueue(LinkQueue&Q,Care)Queue
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 停车场 管理 系统 源代码
![提示](https://www.taowenge.com/images/bang_tan.gif)
限制150内