所属分类:
其他
开发工具:C/C++
文件大小:2KB
下载次数:1
上传日期:2017-06-16 14:58:16
说明: 已知n个人(以编号1,2,3...n分别表示)围坐在一张圆桌周围。从编号为k的人开始报数,数到m的那个人出列;他的下一个人又从1开始报数,数到m的那个人又出列;依此规律重复下去,直到圆桌周围的人全部出列。通常解决这类问题时我们把编号从0~n-1,最后[1] 结果+1即为原问题的解。
(Known n individuals (represented by numbers 1, 2, 3,..., n) sit around a round table. K from a number of people start off, the man out of the line to the m; his next person and from 1 to start off, count to m that another person out; so law be repeated until all of the people out round table. Usually, when solving this kind of problem, we put numbers from 0~n-1, and finally [1] results +1, which is the solution of the original problem.)
文件列表:
约瑟夫环1.cpp
约瑟夫环2.cpp
约瑟夫环.cpp