文件名称:tingchechang
介绍说明--下载内容均来自于网络,请自行研究使用
停车场管理首先,实现栈和队列的基本操作,在此基础上,实现停车场管理。
停车场管理问题描述:设停车场是一个可停放n辆车的狭长通道,且只有一个大门可供汽车进出。在停车场内,汽车按到达的先后次序,由北向南依次排列(假设大门在最南端)。若车场内已停满n辆车,则后来的汽车需在门外的便道上等候,当有车开走时,便道上的第一辆车即可开入。当停车场内某辆车要离开时,在它之后进入的车辆必须先退出车场为它让路,待该辆车开出大门后,其它车辆再按原次序返回车场。每辆车离开停车场时,应按其停留时间的长短交费(在便道上停留的时间不收费)。
试编写程序,模拟上述管理过程。要求以顺序栈模拟停车场,以链队列模拟便道。
从终端读入汽车到达或离去的数据,每组数据包括三项:
① 是“到达”还是“离去”;
② 汽车牌照号码;
③ “到达”或“离去”的时刻。
与每组输入信息相应的输出信息为:
如果是到达的车辆,则输出其在停车场中或便道上的位置;
如果是离去的车辆,则输出其在停车场中停留的时间和应交的费用。
(提示:需另设一个栈,临时停放为让路而从车场退出的车。)
-First of all, car park management, the realization of the basic stack and queue operations, on this basis, the achievement of the car park management.
Descr iption of the car park management: for the parking of the car park is a strip of n-channel vehicles, and there is only one door open to motor out. In the parking lot, the vehicle according to the order of arrival, from north to south in order of priority (assuming the door at the southern tip). If the vehicle has been parked inside vehicles over n, then later in the car to be waiting outside the pavement, when a car driven away, the sidewalk on the first car to be opened. When parking vehicles within a certain time to leave, after it entered the vehicle must first withdraw from the yard to make way for it to be out of the car door, the other vehicles and then order the return of the original car. When the vehicle left the parking lot, should be the length of their stay paid (in the pavement at the time to stay free of charge).
T
停车场管理问题描述:设停车场是一个可停放n辆车的狭长通道,且只有一个大门可供汽车进出。在停车场内,汽车按到达的先后次序,由北向南依次排列(假设大门在最南端)。若车场内已停满n辆车,则后来的汽车需在门外的便道上等候,当有车开走时,便道上的第一辆车即可开入。当停车场内某辆车要离开时,在它之后进入的车辆必须先退出车场为它让路,待该辆车开出大门后,其它车辆再按原次序返回车场。每辆车离开停车场时,应按其停留时间的长短交费(在便道上停留的时间不收费)。
试编写程序,模拟上述管理过程。要求以顺序栈模拟停车场,以链队列模拟便道。
从终端读入汽车到达或离去的数据,每组数据包括三项:
① 是“到达”还是“离去”;
② 汽车牌照号码;
③ “到达”或“离去”的时刻。
与每组输入信息相应的输出信息为:
如果是到达的车辆,则输出其在停车场中或便道上的位置;
如果是离去的车辆,则输出其在停车场中停留的时间和应交的费用。
(提示:需另设一个栈,临时停放为让路而从车场退出的车。)
-First of all, car park management, the realization of the basic stack and queue operations, on this basis, the achievement of the car park management.
Descr iption of the car park management: for the parking of the car park is a strip of n-channel vehicles, and there is only one door open to motor out. In the parking lot, the vehicle according to the order of arrival, from north to south in order of priority (assuming the door at the southern tip). If the vehicle has been parked inside vehicles over n, then later in the car to be waiting outside the pavement, when a car driven away, the sidewalk on the first car to be opened. When parking vehicles within a certain time to leave, after it entered the vehicle must first withdraw from the yard to make way for it to be out of the car door, the other vehicles and then order the return of the original car. When the vehicle left the parking lot, should be the length of their stay paid (in the pavement at the time to stay free of charge).
T
(系统自动生成,下载前可以参看下载内容)
下载文件列表
停车厂管理.txt