文件名称:tingchechang
介绍说明--下载内容均来自于网络,请自行研究使用
问题描述:
设停车场是一个可停放n 辆汽车的狭长通道,且只有一个大门可供汽车进出。汽车在停车场内按车辆达到时间的先后顺序,依次由北向南排列(大门在最南端,最先达到的第一辆车停放在车场的最北端),若车场内已停满n辆汽车,则后来的汽车只能在门外的便道上等候,一旦有车开走,则排在便道上的第一辆车即可开入;当停车场内某辆车要离开时,在它之后进入的车辆必须先退车车场为它让路,待赶辆车开出大门外,其它车辆在按原次序进入车场,每辆停放在车场的车在它离开停车场时必须按它停留的时间长短叫纳费用。试为停车场编制按上述要求进行管理的模拟程序。(Problem descr iption:
A parking lot is a long and narrow channel that can park n cars, and only one door is available for cars to come in and out. The car according to the time order to vehicles in the parking lot, in turn arranged from north to South (entrance at the southern tip of the first to reach the first car parked in the yard of the most northern end), if the car had been parked inside the N car, then the car can only be waiting on the sidewalk outside, when a car drove off. Then came in the first car on the pavement can be opened into the parking lot; when a car to leave, after it entered the vehicle must first car back yard to make way for it, to catch the car out of the gate, the other in the vehicle into the yard of the original order, every car parked in the car in the yard it left the parking lot according to the length of time it stays named cost. A simulation program for parking lot management according to the above requirements is designed.
.)
设停车场是一个可停放n 辆汽车的狭长通道,且只有一个大门可供汽车进出。汽车在停车场内按车辆达到时间的先后顺序,依次由北向南排列(大门在最南端,最先达到的第一辆车停放在车场的最北端),若车场内已停满n辆汽车,则后来的汽车只能在门外的便道上等候,一旦有车开走,则排在便道上的第一辆车即可开入;当停车场内某辆车要离开时,在它之后进入的车辆必须先退车车场为它让路,待赶辆车开出大门外,其它车辆在按原次序进入车场,每辆停放在车场的车在它离开停车场时必须按它停留的时间长短叫纳费用。试为停车场编制按上述要求进行管理的模拟程序。(Problem descr iption:
A parking lot is a long and narrow channel that can park n cars, and only one door is available for cars to come in and out. The car according to the time order to vehicles in the parking lot, in turn arranged from north to South (entrance at the southern tip of the first to reach the first car parked in the yard of the most northern end), if the car had been parked inside the N car, then the car can only be waiting on the sidewalk outside, when a car drove off. Then came in the first car on the pavement can be opened into the parking lot; when a car to leave, after it entered the vehicle must first car back yard to make way for it, to catch the car out of the gate, the other in the vehicle into the yard of the original order, every car parked in the car in the yard it left the parking lot according to the length of time it stays named cost. A simulation program for parking lot management according to the above requirements is designed.
.)
相关搜索: 栈和队列
(系统自动生成,下载前可以参看下载内容)
下载文件列表
tingchechang.cpp