文件名称:1

  • 所属分类:
  • 其他游戏
  • 资源属性:
  • [Windows] [Visual C] [源码]
  • 上传时间:
  • 2012-11-26
  • 文件大小:
  • 97kb
  • 下载次数:
  • 0次
  • 提 供 者:
  • 李*
  • 相关连接:
  • 下载说明:
  • 别用迅雷下载,失败请重下,重下不扣分!

介绍说明--下载内容均来自于网络,请自行研究使用

一条贪吃的蛇在一个n*m的网格中游走,它只能从一个方格走向另一个相邻的方格,这里相邻的意思是两个方格有公共边。每个方格可以看作是一个房间,其中一些是空的,一些存放有苹果。贪吃的蛇根本不进入空的房间,而进入有苹果的房间后就可以带走所有苹果使房间成为空的。蛇从一个指定的房间出发,最终回到它的家,把一路带来的苹果存储到家中,当然,它希望带来的苹果最多。请编写程序,输入有整数n和m,及n*m的一个矩阵,矩阵元素数值中有一个是 -1,表示蛇的出发位置,有一个是 -2,表示蛇的家的位置,其余数值是非负整数,0表示房间为空,非零整数表示苹果的数目。输出蛇选择的游走路径和获得的最多的苹果数目。-A greedy snake in an n* m grid walk, it is only from one box to another box adjacent to the meaning here adjacent to the two squares have a common edge. Each square can be seen as a room, some of which are empty, some of the stored apples. Gluttonous snake did not enter an empty room, and enter the room with Apple can be taken away after all Apple to make the room become empty. Snake starting from a designated room, and eventually return to its home, the Apple store all the way to bring home, of course, it hopes to bring the apple up to. Write the program, enter the integers n and m and n* m of a matrix, the matrix element value is a-1, said the snake to the starting position, there is a 2, said the location of the snake' s home, and the remaining value non-negative integer, and 0 indicates that the room is empty, a non-zero integer number of Apple. Output snake choose to walk the path and get the maximum number of Apple.
(系统自动生成,下载前可以参看下载内容)

下载文件列表

Debug\贪吃的蛇.exe

removejunk.bat

贪吃的蛇.cpp

贪吃的蛇.dsp

贪吃的蛇.dsw

贪吃的蛇.plg

Debug

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度更多...
  • 请直接用浏览器下载本站内容,不要使用迅雷之类的下载软件,用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*主  题:
*内  容:
*验 证 码:

源码中国 www.ymcn.org