文件名称:b
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:5.24kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
【问题描述】:
有一个渡口,每条渡轮一次能装载10辆汽车过江,过江车辆分为客车和货车两类,上渡轮有如下规定:
⑴同类汽车先到先上船;
⑵客车先于货车上船;
⑶每上4辆客车才允许上一辆货车,但若等待的客车不足4辆则用货车填补,反过来,若没有货车等待则用客车填补;
⑷装满10辆后则自动开船,当等待时间较长时车辆不足10辆也应人为控制发船。
【实现提示】:
此题可建立和使用两个链式队列,一个为客车队列,另一个为货车队列,到渡口需过江的汽车分别进入到相应队列中。当渡口有渡轮时先让客车队列中的4部客车出队并开进渡轮,再让货车队列中的4部货车出队并开进渡轮,若某一类车辆队列为空则从另一队列中补充。当渡轮上装满10辆后则自动开船,此时应输出已装每辆车的车号。若装载不足10辆,但两个车辆队列全为空,应继续等待一段时间,若等待时间较长,仍不满载则应人为控制开船。
-Descr iption of the problem:
There is a ferry, and each ferry will carry a 10 car crossing the river, the river traffic is divided into two types of passenger cars and trucks, on the ferry the following provisions:
⑴ similar first-come, first car on board
⑵ bus before the goods on board
⑶ 4 per passenger on board a goods vehicle will be allowed, but waiting for the bus less than 4 are filled with goods, in turn, if there is no vehicle waiting for the bus to fill with
⑷ filled automatically after 10 set sail, when the waiting time less than 10 when the vehicle should also be made artificially control the ship.
【Achieve prompt:
This title can be established and the use of two chain queue, a queue for the bus, and another queue for the goods, to take the ferry crossing the river into the car, respectively, the corresponding queue. When there are ferry crossing bus queue when the first four of the team bus and into the ferry, the queue of trucks allowed four trucks and
有一个渡口,每条渡轮一次能装载10辆汽车过江,过江车辆分为客车和货车两类,上渡轮有如下规定:
⑴同类汽车先到先上船;
⑵客车先于货车上船;
⑶每上4辆客车才允许上一辆货车,但若等待的客车不足4辆则用货车填补,反过来,若没有货车等待则用客车填补;
⑷装满10辆后则自动开船,当等待时间较长时车辆不足10辆也应人为控制发船。
【实现提示】:
此题可建立和使用两个链式队列,一个为客车队列,另一个为货车队列,到渡口需过江的汽车分别进入到相应队列中。当渡口有渡轮时先让客车队列中的4部客车出队并开进渡轮,再让货车队列中的4部货车出队并开进渡轮,若某一类车辆队列为空则从另一队列中补充。当渡轮上装满10辆后则自动开船,此时应输出已装每辆车的车号。若装载不足10辆,但两个车辆队列全为空,应继续等待一段时间,若等待时间较长,仍不满载则应人为控制开船。
-Descr iption of the problem:
There is a ferry, and each ferry will carry a 10 car crossing the river, the river traffic is divided into two types of passenger cars and trucks, on the ferry the following provisions:
⑴ similar first-come, first car on board
⑵ bus before the goods on board
⑶ 4 per passenger on board a goods vehicle will be allowed, but waiting for the bus less than 4 are filled with goods, in turn, if there is no vehicle waiting for the bus to fill with
⑷ filled automatically after 10 set sail, when the waiting time less than 10 when the vehicle should also be made artificially control the ship.
【Achieve prompt:
This title can be established and the use of two chain queue, a queue for the bus, and another queue for the goods, to take the ferry crossing the river into the car, respectively, the corresponding queue. When there are ferry crossing bus queue when the first four of the team bus and into the ferry, the queue of trucks allowed four trucks and
(系统自动生成,下载前可以参看下载内容)
下载文件列表
轮船渡口管理/classCar.h
轮船渡口管理/classShip.h
轮船渡口管理/function.h
轮船渡口管理/LinQueue.h
轮船渡口管理/main.cpp
轮船渡口管理/ReadMe.txt
轮船渡口管理
轮船渡口管理/classShip.h
轮船渡口管理/function.h
轮船渡口管理/LinQueue.h
轮船渡口管理/main.cpp
轮船渡口管理/ReadMe.txt
轮船渡口管理
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.