课程设计:停车场 c 语言版本的数据结构课程设计,要求用栈模拟停车场,用队列模拟便道,实现停车场的收费管理系统 停车场停满车后车会停在便道上面 下面附上源码,vc:(下编译 #include //#include //malloc #include //获取系统时间所用函数 #include //getch() #include //设置光标信息 mallco #define MaxSize 5 /*定义停车场栈长度*/ #define PRICE 0.05 /*每车每分钟收费值*/ #define BASEPRICE 0.5 //基础停车费 #define Esc 27 //退出系统 #define Exit 3 //结束对话 #define Stop 1 //停车 #define Drive 2 //取车 int jx=0,jy=32; //全局变量日志打印位置 typedef struct {int hour; int minute; }Time,*PTime; /*时间结点*/ typedef struct /*定义栈元素的类型即车辆信息结点*/ {int num ; /*车牌号*/ Time arrtime; /*到达时刻或离区时刻*/ }CarNode; typedef struct /*定义栈,模拟停车场*/ {CarNode stack[MaxSize]; int top; }SqStackCar; typedef struct node /*定义队列结点的类型*/ {int num; /*车牌号*/ struct node *next; }QueueNode; typedef struct /*定义队列,模拟便道*/ {QueueNode *front,*rear; }LinkQueueCar; /*函数声明*/ PTime get_time(); CarNode getcarInfo(); void qingping(int a); void gotoxy(int x,int y); void printlog(Time t,int n,int io,char ab,int po,double f); void printstop(int a,int num,int x0,int y0); void printleave(int a,int po,int num); /*初始化栈*/ void InitSeqStack(SqStackCar *s) { s->top=-1; } /* push 入站函数 */ int push(SqStackCar *s,CarNode x) //数据元素 x 入指针 s 所指的栈 { if(s->top==MaxSize-1) return(0); //如果栈满,返回 0 else { s->stack[++s->top]=x; //栈不满,到达车辆入栈 return(1); } } /*栈顶元素出栈*/ CarNode pop(SqStackCar *s) { CarNode x; if(s->top<0) { x.num=0; x.arrtime.hour=0; x.arrtime.minute=0; return(x); //如果栈空,返回空值 } else { s->top--; return(s->stack[s->top+1]); //栈不空,返回栈顶元素 } } /*初始化队列*/ void InitLinkQueue(LinkQueueCar *q) { q->front=(Queu...