hanoi

所属分类:其他小程序
开发工具:Visual C++
文件大小:1KB
下载次数:100
上传日期:2008-05-26 16:40:40
上 传 者zhongbo
说明:  hanoi塔问题描述:有a,b,c三个塔座。开始时,在塔座上有一叠共n个圆盘,这些圆盘自下而上,由大到小地叠在一起。各圆盘从小到大编号为1,2,....,n。现在要求将塔座a上的这一叠圆盘移动到塔座b上,并仍按同样顺序叠置。在移动圆盘时应遵守以下移动规则: (1)每次只能移动一个圆盘 (2)任何时刻都不允许将较大的圆盘压在较小的圆盘之上 (3)在满足规则(1),(2)的前提下,可将圆盘a,b,c中任何一塔座上
(tower of hanoi Description: have a, b, c three塔座. Initially, in塔座on a total of n has a pile of disks, these disks bottom-up, descending to stack together. The disc from small to large number 1,2 ,...., n. Now requested that塔座a disc on the stack to move to塔座b, and is still the same order, stacked. In the mobile disk mobile rules should comply with the following: (1) can only move one disc (2) any time does not permit a larger disc pressure in the smaller disk on top of (3) in meeting the rules (1), (2) under the premise of the disc may be a, b, c 1塔座on any)

文件列表:
hanoi.cpp (657, 2008-05-26)

近期下载者

相关文件


收藏者