资 源 简 介
约瑟夫环:编号为1,2,3,…,n的n个人按顺时针方向围坐一圈,每人持有一个密码(正整数)。一开始任选一个正整数作为报数的上限值m,从第一个人开始按顺时针方向自1开始顺序报数,报到m时停止。报m的人出列,将他的密码作为新的m值,从他在顺时针方向上的下一人开始重新从1报数,如此下去,直到所有人全部出列为止。编程打印出列顺序。-Josephus : No. 1, 2, 3, ..., n n clockwise direction by individuals sitting around a circle, each holding a password (positive integers). An optional started as a positive integer reported limits on the number of m, from the first individuals to embark on the clockwise direction since the beginning of a sequence number off, the report m stop. M reported out of the list of his password as a new value m, from a clockwise direction in the next one started from a newspaper a few, like that, until the total of all listed so far. Programming print out the order.