文件名称:passrive
介绍说明--下载内容均来自于网络,请自行研究使用
编程完成商人过河游戏:有三个商人带着三个随从和货物过河,船每次最多只能载两个人,由他们自己划行,并且如何乘船渡河的大权由商人掌握。要求保证在过河期间的任一岸上商人的人数要大于或等于随从的人数,否则随从会*商人抢走货物。设计一个符合上述要求的商人过河的游戏。要求程序运行效果如下图。
(1)有游戏规则提示,按任意键开始游戏,按“Q”键退出游戏;
(2)程序开始,分别提示每次从河岸这边到那边、从河岸那边到这边的商人和随从人数;
(3)如果输入错误(如一次输入的人数不得超过2个、过河的人数不得超过2个),则提示错误并且按任意键重新开始游戏;
(4)当任一河岸的商人数小于随从数时,提示商人被杀,按任意键继续游戏;
(5)当游戏成功时提示游戏成功,按任意键结束游戏。-Programming complete businessman across the river game: there are three businessmen with three follow and cargo across the river, the ship most every time can only take two people, by their own oar, and how to cross the river by boat power by businessmen master. Requirements that the river during the period of the number of any shore businessman than or equal to the number of people followed, otherwise follow will kill traders take goods. Design a meet above requirement businessman across the river of the game. For program execution effect as the chart.
(1)有游戏规则提示,按任意键开始游戏,按“Q”键退出游戏;
(2)程序开始,分别提示每次从河岸这边到那边、从河岸那边到这边的商人和随从人数;
(3)如果输入错误(如一次输入的人数不得超过2个、过河的人数不得超过2个),则提示错误并且按任意键重新开始游戏;
(4)当任一河岸的商人数小于随从数时,提示商人被杀,按任意键继续游戏;
(5)当游戏成功时提示游戏成功,按任意键结束游戏。-Programming complete businessman across the river game: there are three businessmen with three follow and cargo across the river, the ship most every time can only take two people, by their own oar, and how to cross the river by boat power by businessmen master. Requirements that the river during the period of the number of any shore businessman than or equal to the number of people followed, otherwise follow will kill traders take goods. Design a meet above requirement businessman across the river of the game. For program execution effect as the chart.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
商人过河游戏\207.C
............\207.EXE
商人过河游戏