c语言停车场管理系统源代码

c语言停车场管理系统源代码

ID:10658892

大小:53.50 KB

页数:8页

时间:2018-07-07

c语言停车场管理系统源代码_第1页
c语言停车场管理系统源代码_第2页
c语言停车场管理系统源代码_第3页
c语言停车场管理系统源代码_第4页
c语言停车场管理系统源代码_第5页
资源描述:

《c语言停车场管理系统源代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、#include#include#definestacksize2//车站//容量///////////////////////////////////////////////////////typedefstructSnode{intnumber;floatint_time[2];floatbian_time[2];}record;typedefstruct{record*base;record*top;intsize;}Stack;/////////////

2、////////////////////////////////////////typedefstructQnode{intnumber;floatint_time[2];structQnode*next;}Qnode,*Queue;typedefstruct{Queuefront;Queuerear;}Linkqueue;voidxunhuan(StackL,LinkqueueQ);voidjixu(StackL,LinkqueueQ);//////////////////////////////

3、////////////////////////////////////////////////////////////////////////////voidInitStack(Stack&L)//堆栈操作{L.base=(record*)malloc(sizeof(Snode)*stacksize);if(!L.base)exit(0);L.top=L.base;L.size=stacksize;}/////////////////////////////////////////////////

4、////voidinput(Stack&L,recordh){*L.top++=h;}///////////////////////////////////////////////////Snodeoutput(Stack&L,record&e){e=*--L.top;returne;}intStackman(StackL){if(L.top-L.base==L.size)return0;elsereturn1;}intStackEmpty(StackL){if(L.base==L.top)retu

5、rn0;elsereturn1;}////////////////////////////////////////////////////////////////////////////////////////////////////voidInitque(Linkqueue&Q)//队列操作{Q.front=Q.rear=(Queue)malloc(sizeof(Qnode));if(!Q.front)exit(0);Q.front->next=NULL;}////////////////////

6、//////////////////////////////voidenqueue(Linkqueue&Q,intnumber,floattime[]){Queueq;printf("停车场已满,请将车辆停入便道!");q=(Queue)malloc(sizeof(Qnode));q->int_time[0]=time[0];q->int_time[1]=time[1];q->number=number;q->next=NULL;Q.rear->next=q;Q.rear=q;}////////

7、///////////////////////////////////////////voidoutqueue(Linkqueue&Q,Queue&e)//此处有点问题??????????????{//Qnode*q;//q=(Queue)malloc(sizeof(Qnode));e=Q.front->next;//Q.front->next=q->next;//deleteq;Q.front->next=Q.front->next->next;if(Q.rear==e){Q.front=Q.re

8、ar;//Q.front=NULL;}}intQEmpty(LinkqueueQ){if(Q.rear==Q.front)return0;elsereturn1;}//////////////////////////////////////////////////////停车场管理操作////////////////////////////////////////////////////voidjixu(StackL,LinkqueueQ){intn;fflush(s

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。