文件名称:Josephus
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:6.4kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
约瑟夫环问题:设编号为1,2,3,……,n的n(n>0)个人按顺时针方向围坐一圈,每个人持有一个正整数密码。开始时任选一个正整数做为报数上限m,从第一个人开始顺时针方向自1起顺序报数,报到m是停止报数,报m的人出列,将他的密码作为新的m值,从他的下一个人开始重新从1报数。如此下去,直到所有人全部出列为止。令n最大值取30。要求设计一个程序模拟此过程,求出出列编号序列-Josephus problem: Let numbered 1, 2, 3, ...... n n (n> 0) individuals sitting around a circle in a clockwise direction, each person holds a positive integer password. Optional when the start of a positive integer as reported the maximum number of m clockwise direction from the first person, self-a starting sequence reported number, report m stop the reported number of reported m the column, as a new password the value of m, start again from 1 number off from his next personal. It goes on, until all the columns until all. Let n be the maximum take 30. Asked to design a program to simulate the process, find the column number sequence
(系统自动生成,下载前可以参看下载内容)
下载文件列表
2/1.cpp
2/1.dsp
2/1.dsw
2/1.ncb
2/1.opt
2/1.plg
2/
2/1.dsp
2/1.dsw
2/1.ncb
2/1.opt
2/1.plg
2/
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.