商人过河c语言编程,商人过河C语言程序编程.docx

#include

#include

#include

void basic_interface() //基本界面

{

system("clear");

system("tput cup 5 20");

printf("==========================================

====================================================\n");

system("tput cup 6 20");

printf("*

*\n");

system("tput cup 7 20");

printf("* ^_^欢迎使用商 人过河游戏!^_^ *\n");

system("tput cup 8 20");

printf("*

*\n");

system("tput cup 9 20");

printf("* 游戏说明:

*\n");

system("tput cup 10 20");

printf("* 三个商人带着三个随从和货物过河,船每次最 多只能载两个人,要求在过河期间,任一岸上商人的人数 *\n");

system("tput cup 11 20");

printf("* 要大于或等于随从的人数,否则随从会杀掉商 人抢走货物。 *\n");

system("tput cup 12 20");

printf("*

*\n");

system("tput cup 13 20");

printf("* 游戏操作:

*\n");

system("tput cup 14 20 ");

printf("* (1)依次输入过河的商人和随从人

数;

*\n");

system("tput cup 15 20");

printf("* (2)非法输入按键将重新开始。

*\n");

system("tput cup 16 20");

printf("*-----------------------------------------

---------------------------------------------------

*\n");

system("tput cup 17

20");printf("*\n");system("tput cup 17

113");printf("*\n");

system("tput cup 18

20");printf("*\n");system("tput cup 18

113");printf("*\n");

system("tput cup 19

20");printf("*\n");system("tput cup 19

113");printf("*\n");

system("tput cup 20

20");printf("*\n");system("tput cup 20

113");printf("*\n");

system("tput cup 21

20");printf("*\n");system("tput cup 21

113");printf("*\n");

system("tput cup 22

20");printf("*\n");system("tput cup 22

113");printf("*\n");

system("tput cup 23

20");printf("*\n");system("tput cup 23

113");printf("*\n");

system("tput cup 24

20");printf("*\n");system("tput cup 24

113");printf("*\n");

system("tput cup 25

20");printf("*\n");system("tput cup 25

113");printf("*\n");

system("tput cup 26

20");printf("*\n");system("tput cup 26

113");printf("*\n");

system("tput cup 27

20");printf("*\n");system("tput cup 27

113");printf("*\n");

system("tput cup 28 20");

printf("******************************************

****************************************************\n");

}

char a[6]; //此岸

char b[6]; /

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值