文件名称:安全过河问题
介绍说明--下载内容来自于网络,使用问题请自行百度
该游戏是我由一个数学建模题——“安全过河问题”而构思的。有三个商人带者三个随从和货物过河,
船每次最多只能载两个人,要求保证在过河期间商人的人数要大于或等于随从的人数,否则随从杀人抢货。
构思:
用两个数组来表示两岸的商人和随从,其中 A 表示商人, B 表示随从,数组a 表示此岸,数组b表示彼岸
通过输入过河的人数,来改变两个数组中的 A 和 B 的个数,在用文本输出两岸的情况.
游戏规则是这样似的:
1)输入过河的人数;
2)非法输入按按了退出处理(如:每次输入的人数不得多于两个 不得输入负数,字母等).
-the game is a mathematical modeling that -- "security across the river" and ideas. There are three businessmen with close to three persons and goods across the river, each boat can set up two, sought assurances in the river during a number of businessmen to accompany greater than or equal to the number of followers to kill or get goods. Concept : The two arrays to show both sides of the businessmen and entourage, which traders said A, B said followers a array expressed on this side, the other side of the array b indicated by the number of imported river, to change the two arrays A and B number, the text output with the cross-strait situation. the rules of the game is like this : 1) The number of imported river; 2) The illegal importation by the withdrawal by processing (eg : ever
船每次最多只能载两个人,要求保证在过河期间商人的人数要大于或等于随从的人数,否则随从杀人抢货。
构思:
用两个数组来表示两岸的商人和随从,其中 A 表示商人, B 表示随从,数组a 表示此岸,数组b表示彼岸
通过输入过河的人数,来改变两个数组中的 A 和 B 的个数,在用文本输出两岸的情况.
游戏规则是这样似的:
1)输入过河的人数;
2)非法输入按按了退出处理(如:每次输入的人数不得多于两个 不得输入负数,字母等).
-the game is a mathematical modeling that -- "security across the river" and ideas. There are three businessmen with close to three persons and goods across the river, each boat can set up two, sought assurances in the river during a number of businessmen to accompany greater than or equal to the number of followers to kill or get goods. Concept : The two arrays to show both sides of the businessmen and entourage, which traders said A, B said followers a array expressed on this side, the other side of the array b indicated by the number of imported river, to change the two arrays A and B number, the text output with the cross-strait situation. the rules of the game is like this : 1) The number of imported river; 2) The illegal importation by the withdrawal by processing (eg : ever
(系统自动生成,下载前可以参看下载内容)
下载文件列表
安全过河问题.txt
www.dssz.com.txt
www.dssz.com.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.