课程设计:停车场 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(); Car