文件名称:2
介绍说明--下载内容均来自于网络,请自行研究使用
设有一个可以停放n辆汽车的狭长停车场,它只有一个大门可以供车辆进出。车辆按到达停车场时间的早晚依次从停车场最里面向大门口处停放(最先到达的第一辆车放在停车场的最里面)。如果停车场已放满n辆车,则后来的车辆只能在停车场大门外的便道上等待,一旦停车场内有车开走,则排在便道上的第一辆车就进入停车场。停车场内如有某辆车要开走,在它之后进入停车场的车都必须先退出停车场为它让路,待其开出停车场后,这些车辆再依原来的次序进场。每辆车在离开停车场时,都应根据它在停车场内停留的时间长短交费。如果停留在便道上的车未进停车场就要离去,允许其离去,不收停车费,并且仍然保持在便道上等待的车辆的次序。编制一个程序模拟该停车场的管理。
实现要求: 要求程序输出每辆车到达后的停车位置(停车场或便道上),以及某辆车离开停车场时应交纳的费用(费率自定)和它在停车场内停留的时间,并自拟一个实验实例进行验证。
提示:汽车的模拟输入信息格式可以是:(到达/离去,汽车牌照号码,到达/离去的时刻)。例如,(‘A’,,1,5)表示1号牌照车在5这个时刻到达,而(‘D’,,5,20)表示5号牌照车在20这个时刻离去。整个程序可以在输入信息为(‘E’,0,0)时结束。-With a parked car n can be long and narrow parking lot, it has only a door for vehicle pass in and out. According to the parking lot of the vehicle to time in the morning and evening from the parking lot in the park gate. If the parking lot already puts full n car, then later in the parking lot outside the vehicle can only the curb waiting, once left a parking lot, the row in the curb first car into the parking lot. Parking lot if there is a car to drive away, after it into the parking lot of the car has to be out for its first parking lot way, until the open after parking lot, these vehicles in accordance with the original order comes into play again. Every car in the parking lot left, should according to it in the parking lot stay within the length of time pay. If the stay in curb car into the parking lot is not about to leave, allowing him to go, do not collect fee, and still remain in the pavement waiting for the order of the vehicle, simulation of the parking management.
实现要求: 要求程序输出每辆车到达后的停车位置(停车场或便道上),以及某辆车离开停车场时应交纳的费用(费率自定)和它在停车场内停留的时间,并自拟一个实验实例进行验证。
提示:汽车的模拟输入信息格式可以是:(到达/离去,汽车牌照号码,到达/离去的时刻)。例如,(‘A’,,1,5)表示1号牌照车在5这个时刻到达,而(‘D’,,5,20)表示5号牌照车在20这个时刻离去。整个程序可以在输入信息为(‘E’,0,0)时结束。-With a parked car n can be long and narrow parking lot, it has only a door for vehicle pass in and out. According to the parking lot of the vehicle to time in the morning and evening from the parking lot in the park gate. If the parking lot already puts full n car, then later in the parking lot outside the vehicle can only the curb waiting, once left a parking lot, the row in the curb first car into the parking lot. Parking lot if there is a car to drive away, after it into the parking lot of the car has to be out for its first parking lot way, until the open after parking lot, these vehicles in accordance with the original order comes into play again. Every car in the parking lot left, should according to it in the parking lot stay within the length of time pay. If the stay in curb car into the parking lot is not about to leave, allowing him to go, do not collect fee, and still remain in the pavement waiting for the order of the vehicle, simulation of the parking management.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
停车场管理.c