文件名称:Test(2)
介绍说明--下载内容均来自于网络,请自行研究使用
用循环单链表实现:
N个人围圆圈而坐,分别标以数字1到N。从坐在1号的位置的人开始依次传递土豆。M次传递之后,拿到土豆的人被排除,圆圈收缩,然后从离开圆桌的人后面的那个人开始继续游戏。游戏一直进行,直到留下最后一个人,为赢家。因此,如果M=0且N=5,所有的人依次被排除,5号最后胜利。如果M=1且N=5,排除的顺序为2,4,1,5.
-Achieved with cyclic single-linked list: N individuals sitting around a circle, were marked with numbers 1 to N. No. 1 position from sitting in order, starting with the person passing the potatoes. M after the second pass, to get potatoes were excluded, the circles shrink, and then leave the round table behind the man who started to continue the game. The game has been carried out until the last person left for the winner. Therefore, if M = 0 and N = 5, all the people in turn are excluded, 5, the final victory. If M = 1 and N = 5, excluding the order 2,4,1,5.
N个人围圆圈而坐,分别标以数字1到N。从坐在1号的位置的人开始依次传递土豆。M次传递之后,拿到土豆的人被排除,圆圈收缩,然后从离开圆桌的人后面的那个人开始继续游戏。游戏一直进行,直到留下最后一个人,为赢家。因此,如果M=0且N=5,所有的人依次被排除,5号最后胜利。如果M=1且N=5,排除的顺序为2,4,1,5.
-Achieved with cyclic single-linked list: N individuals sitting around a circle, were marked with numbers 1 to N. No. 1 position from sitting in order, starting with the person passing the potatoes. M after the second pass, to get potatoes were excluded, the circles shrink, and then leave the round table behind the man who started to continue the game. The game has been carried out until the last person left for the winner. Therefore, if M = 0 and N = 5, all the people in turn are excluded, 5, the final victory. If M = 1 and N = 5, excluding the order 2,4,1,5.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Test(2).txt