文件名称:3
- 所属分类:
- 控制台(字符窗口)编程
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 150kb
- 下载次数:
- 0次
- 提 供 者:
- STar****
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
关于猎人过河问题 要解决这个问题就要使过河时载两个过河,返回时尽量只有一个回来。用一个字符串数组来存猎人,狼,羊,白菜;下标依次为0,1,2,3;但他们都有河这边和那边两种状态;为方便则定义一个结构,只含一个int型变量n;当在河这边时n设为0;在河那边时n设为1。由于每次过河与返回都要考虑狼能否吃羊或羊能否吃白菜;则需要一个函数来判断每次选择是否满足条件。-Hunters across the river on the issues to resolve this issue so we should cross the river when the two set out across the river to return to when there is only one back as far as possible. Using a string array to keep hunters, the wolf, sheep, and cabbage subscr ipt followed by 0,1,2,3 but they have a river here and there two states To facilitate the definition of a structure containing only an int variable n When in the river here when n is set to 0 in the river when n is set to one side. Due to cross the river and return each time to consider whether the wolf can eat the sheep吃羊or cabbage you need a function to determine each choose whether or not to meet the conditions.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
3
.\3.cpp
.\3.dsp
.\3.dsw
.\3.ncb
.\3.opt
.\3.plg
.\Debug
.\3.cpp
.\3.dsp
.\3.dsw
.\3.ncb
.\3.opt
.\3.plg
.\Debug