文件名称:Park
介绍说明--下载内容均来自于网络,请自行研究使用
1 问题描述
设有一个可以停放n辆汽车的狭长停车场,它只有一个大门可以供车辆进出。车辆按到达停车场时间的早晚,依次从停车场最里面向大门口处停放。如果停车场已放满n辆车,则后来的车辆只能在停车场大门外的便道上等待,一旦停车场内有车开走,则排在便道上的第一辆车就进入停车场。停车场内如有某辆车要开走,在它之后进入停车场的车都必须退出停车场为它让路,待其开出停车场后,这些车辆再依原来的次序进场。每辆车在离开停车场时,都应根据它在停车场内停留的时间长短来交费。如果停留在便道上的车未进入停车场就要离去,允许其离开,不收停车费,并且仍然保持在便道上等待的车辆次序。编制一个程序模拟该停车场的管理。
2 实现要求
要求程序输出每辆车到达后的停车位置(停车场或便道),以及某辆车离开停车场时应该交纳的费用和它在停车场内停留的时间。
3 实现提示
汽车的模拟输入信息格式可以为:(到达/离开,汽车牌照号码,到达/离开的时间)。用栈和队列来模拟停车场和便道。-1 the problem statement
Equipped with a narrow park n car parking lot, it s only a door for cars in May. According to reach the vehicle in the parking lot, morning and evening time from the parking lot in the park gate oriented. If the parking lot was puts full n car, then later in the parking lot outside the vehicle can only the curb waiting, once the parking lot, the car left the curb first car came into the parking lot. If there is a parking lot to drive away, cars in the parking lot after the car into it for it must exit parking lot, stay the way open parking lot in accordance with these vehicles into the original order again. Every car in the parking lot, they should leave according to stay in the parking lot length of time to pay. If stays in the curb
设有一个可以停放n辆汽车的狭长停车场,它只有一个大门可以供车辆进出。车辆按到达停车场时间的早晚,依次从停车场最里面向大门口处停放。如果停车场已放满n辆车,则后来的车辆只能在停车场大门外的便道上等待,一旦停车场内有车开走,则排在便道上的第一辆车就进入停车场。停车场内如有某辆车要开走,在它之后进入停车场的车都必须退出停车场为它让路,待其开出停车场后,这些车辆再依原来的次序进场。每辆车在离开停车场时,都应根据它在停车场内停留的时间长短来交费。如果停留在便道上的车未进入停车场就要离去,允许其离开,不收停车费,并且仍然保持在便道上等待的车辆次序。编制一个程序模拟该停车场的管理。
2 实现要求
要求程序输出每辆车到达后的停车位置(停车场或便道),以及某辆车离开停车场时应该交纳的费用和它在停车场内停留的时间。
3 实现提示
汽车的模拟输入信息格式可以为:(到达/离开,汽车牌照号码,到达/离开的时间)。用栈和队列来模拟停车场和便道。-1 the problem statement
Equipped with a narrow park n car parking lot, it s only a door for cars in May. According to reach the vehicle in the parking lot, morning and evening time from the parking lot in the park gate oriented. If the parking lot was puts full n car, then later in the parking lot outside the vehicle can only the curb waiting, once the parking lot, the car left the curb first car came into the parking lot. If there is a parking lot to drive away, cars in the parking lot after the car into it for it must exit parking lot, stay the way open parking lot in accordance with these vehicles into the original order again. Every car in the parking lot, they should leave according to stay in the parking lot length of time to pay. If stays in the curb
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Park.txt