文件名称:cPP
介绍说明--下载内容均来自于网络,请自行研究使用
1、约瑟夫问题的一种描述是:编号为1,2,3——,n的n个人按顺时针方向围坐一圈,
每个人持有一个密码(正整数)。一开始任选一个正整数作为报数上线值m,从第一
开始按顺时针方向报数,报到m时停止报数。报m的人出列,将他的密码作为新 的
m值,从他在顺时针方向上的下一个人重新开始从1报数,如此下去,直至所有人
全部出列。
2、程序运行后,首先要求用户指定初始报数上限值,然后读取个人的密码。可设n≤30。
3、测试数据:m=20;n=7;密码一次为:3,1,7,2,4,8,4.
-1, Joseph is a descr iption of the problem: number 1,2,3-, n of n individuals sitting around the circle clockwise,
Each person has a password (positive integer). Choose the beginning of a positive integer value as reported on the line number m, from the first
Reported a clockwise direction starting number, to report m, the number of stops reported. Reported m the person out of the column, as his new password
m value, in the clockwise direction from his personal resume on the next number from a newspaper, and so on, until all
All the columns.
2, the program runs, the first requires the user to specify a limit on the number of the initial report, then read a personal password. Can be set n ≤ 30.
3, the test data: m = 20 n = 7 password once: 3,1,7,2,4,8,4.
每个人持有一个密码(正整数)。一开始任选一个正整数作为报数上线值m,从第一
开始按顺时针方向报数,报到m时停止报数。报m的人出列,将他的密码作为新 的
m值,从他在顺时针方向上的下一个人重新开始从1报数,如此下去,直至所有人
全部出列。
2、程序运行后,首先要求用户指定初始报数上限值,然后读取个人的密码。可设n≤30。
3、测试数据:m=20;n=7;密码一次为:3,1,7,2,4,8,4.
-1, Joseph is a descr iption of the problem: number 1,2,3-, n of n individuals sitting around the circle clockwise,
Each person has a password (positive integer). Choose the beginning of a positive integer value as reported on the line number m, from the first
Reported a clockwise direction starting number, to report m, the number of stops reported. Reported m the person out of the column, as his new password
m value, in the clockwise direction from his personal resume on the next number from a newspaper, and so on, until all
All the columns.
2, the program runs, the first requires the user to specify a limit on the number of the initial report, then read a personal password. Can be set n ≤ 30.
3, the test data: m = 20 n = 7 password once: 3,1,7,2,4,8,4.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
c++.doc