数据结构课程设计停车场管理系统(源代码)(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))
数据结构课程设计停车场管理系统(源代码)(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 (\
您可能关注的文档
- 我的童年 电视节目(My childhood TV show).doc
- 我的获奖作文(My award-winning composition).doc
- 我的高中简史,上蔡二高之我不是来打酱油的(My brief history of high school, Shangcai two, I am not here to play soy sauce).doc
- 我的治喉法则(My rule of the throat).doc
- 我国粮食分布(Grain distribution in China).doc
- 戒烟趣法(Smoking cessation fun).doc
- 战国城池(Warring States city).doc
- 我的国考经历(完整版)(My national exam experience (full version)).doc
- 战国时代,官职(Office in the Warring States Period).doc
- 战国烽烟起,摆酒论诸侯--地域品牌发展浅析(In the Warring States period, feast on regional brand development of princes).doc
最近下载
- SY_T 5106-2019 石油天然气钻采设备 封隔器规范.docx VIP
- 世界著名谈判案例.docx VIP
- T_CPI 11037-2024 石油天然气钻采设备水力振荡器技术与应用规范.docx VIP
- 雪铁龙维修 手册 图DS_5LS_Owner_Book_ZH.pdf VIP
- 2025至2030药用真菌行业项目调研及市场前景预测评估报告.docx
- T_SCMES 24—2024(石油天然气钻采设备智能钻机).pdf VIP
- 财务共享模式下企业内部控制研究——以延长石油为例.docx VIP
- 财务共享延长石油集成方案.pdf VIP
- 2025《延安延长石油集团财务共享中心实施效果分析的案例报告》8200字.doc VIP
- 2025人教版音乐一年级下册全册教学设计教案.pdf
原创力文档

文档评论(0)