文件名称:安全过河问题
介绍说明--下载内容均来自于网络,请自行研究使用
该游戏是我由一个数学建模题——“安全过河问题”而构思的。有三个商人带者三个随从和货物过河,
船每次最多只能载两个人,要求保证在过河期间商人的人数要大于或等于随从的人数,否则随从杀人抢货。
构思:
用两个数组来表示两岸的商人和随从,其中 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
(系统自动生成,下载前可以参看下载内容)
下载文件列表
压缩包 : 119128670安全过河问题.rar 列表 安全过河问题.txt