文件名称:Josephus-Problem
介绍说明--下载内容均来自于网络,请自行研究使用
约瑟夫问题(Josephus Problem)据说著名犹太历史学家 Josephus有过以下的故事:在罗马人占领乔塔帕特后,39 个犹太人与Josephus及他的朋友躲到一个洞中,39个犹太人决定宁愿死也不要被敌人到,于是决定了一个自杀方式,41个人排成一个圆圈,由第1个人开始报数,每报数到第3人该人就必须自杀,然后再由下一个重新报数,直到所有人都自杀身亡为止。 然而Josephus 和他的朋友并不想遵从,Josephus要他的朋友先假装遵从,他将朋友与自己安排在第16个与第31个位置,于是逃过了这场死亡游戏。   原题:   用户输入M,N值,N个人围成一个环,从0号人开始数,数到M,那个人就退出游戏,直到最后一个人 求最后一个剩下的人是几号?-The problem of Joseph (Josephus Problem) said that the famous Jewish historian Josephus had the following story: in the Romans occupied Qiaotapate, 39 Jews and Josephus and his friends hid in a hole, 39 Jews, the decision would rather die Do not be an enemy to, and decided a means of suicide, 41 individuals arranged in a circle by an individual number off each number off to the third person that the person must commit suicide, and then re-reported the number of the next until all have committed suicide, killed so far. However, Josephus and his friends do not want to comply with Josephus, to be the first to pretend to comply with his friends, he will be friends with their own arrangements in the 16 and 31 position, then escaped the death game. The original question: the user to enter M, N value, N, surrounded by a ring from No. 0 people began to count, count to M, that person will quit the game until the last person to ask the last one the rest of the people is ?
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Josephus Problem.doc