文件名称:famercrossriver
介绍说明--下载内容均来自于网络,请自行研究使用
农夫过河问题描述的是一个农夫带着一只狼、一只羊和一棵白菜,处于河的南岸,而他要将这些东西带到北岸。但是他面前只有一条小船,而每次他只能带一件东西过河,由于食物链的关系,他不能将狼和羊同时留下,也不能将羊和白菜同时留下,但可以将狼和白菜同时留下。编写一段代码,描述农夫所采用的过河方法。
-Problem descr iption farmer across the river is a farmer with a wolf, a sheep and a cabbage, in the south bank of the river, and he brought these things to north. However, only a small boat in front of him, but he could only bring one thing each river, as the relationship between food chain, he can not leave the wolf and the sheep at the same time, nor can the sheep and cabbage leaves at the same time, but it can be the wolf and Chinese cabbage leaves at the same time. Write a code to describe the farmer across the river used method.
-Problem descr iption farmer across the river is a farmer with a wolf, a sheep and a cabbage, in the south bank of the river, and he brought these things to north. However, only a small boat in front of him, but he could only bring one thing each river, as the relationship between food chain, he can not leave the wolf and the sheep at the same time, nor can the sheep and cabbage leaves at the same time, but it can be the wolf and Chinese cabbage leaves at the same time. Write a code to describe the farmer across the river used method.
相关搜索: 农夫过河问题
(系统自动生成,下载前可以参看下载内容)
下载文件列表
famercrossriver.doc