数据结构课程设计停车场管理系统(源代码)(Data structure curriculum design, parking management system (source code)).docVIP

  • 16
  • 0
  • 约5.75千字
  • 约 16页
  • 2017-10-07 发布于河南
  • 举报

数据结构课程设计停车场管理系统(源代码)(Data structure curriculum design, parking management system (source code)).doc

数据结构课程设计停车场管理系统(源代码)(Data structure curriculum design, parking management system (source code))

数据结构课程设计停车场管理系统(源代码)(Data structure curriculum design, parking management system (source code)) # includes stdio.h # includes stdlib.h # includes string.h # define max 3 / / 停车场最大容量为3辆, 便于观察 # define price 0.05 typedef struct time {/ / 定义时间结构体 int hour; int min; } time; typedef struct node {/ / 定义车辆信息结构体 char num [10]. time to reach. time leave. } carnode; typedef struct node { carnode * stack (max + 1); int top; } seqstackcar; typedef struct car { carnode * date; struct car * next; } queuenode; typedef struct node { queuenode * head; queuenode * rear; } linkqueuecar; void initstack (seqstackcar *); int initqueue (linkqueuecar *); int arrival (seqstackcar *, linkqueuecar *); void go (seqstackcar *, seqstackcar *, linkqueuecar *); void list (seqstackcar, linkqueuecar); void main () { seqstackcar enter, temp. linkqueuecar wait; int n; system (color 4a ); initstack ( enter; initstack (a s). initqueue ( a); while (1) { printf (\ n §※§※§※§※§※§ 欢迎使用停车场系统.§※§※§※§※§※§ \ t \ n \ n); printf (\ n \ t※◎※◎※◎※◎ 1. 车辆到达登记.※◎※◎※◎※◎ \ t \ n ); printf (\ n \ t※◎※◎※◎※◎ 2. 车辆离开登记.※◎※◎※◎※◎ \ t \ n ); printf (\ n \ t※◎※◎※◎※◎ 3. 车辆列表显示.※◎※◎※◎※◎ \ t \ n ); printf (\ n \ t※◎※◎※◎※◎ 4. 退出系统.※◎※◎※◎※◎ \ t \ n \ n ); while (1) { printf (请选择:); scanf (% d ch); if (ch = 1 ch = 4) break; else printf (\ n 输入有误, 请重新选择: 1 ~ 4:); } switches (ch) { case 1: arrival ( enter, wait); break; case 2: leave ( enter, temp, wait); break; case 3: list (enter, wait); break; case 4: exit (0); default: break; } } } / / 自定义函数 void initstack (seqstackcar * s) {/ / 栈的初始化 int i; s - top = 0; for (i = 0; i = max; i + +) s - - top stack [d] = null; } int initqueue (linkqueuecar * q) {/ / 队列的初始化 q - a = (queuenode *) malloc (sizeof (queuenode)); if (q - head! = = null) { q - - next head = null; q = q - - rear head; return (1); } else return (- 1). } void print (carnode * p, int room) {/ / 车辆收费 int a1, a2, b1, b2. printf (\ n车辆离开的时间:); scanf (% d:% d (p - leave.hour) (p - leave.min)); printf (\

文档评论(0)

1亿VIP精品文档

相关文档