文件名称:001shuangxiangyuesefu
介绍说明--下载内容均来自于网络,请自行研究使用
已知n个人围坐在一张圆桌周围,首先从编号为 k 的人从1开始顺时针报数,1, 2, 3, ...,记下顺时针数到 m 的那个人,同时从编号为 k 的人开始逆时针报数,1, 2, 3, ...,数到 m 后,两个人同时出列。然后从出列的下一个人又从 1 开始继续进行双向报数,数到m的那两个人同时出列,…。依此重复下去,直到圆桌周围的人全部出列。直到圆桌周围只剩一个人为止。
输入
n,k,m
输出
按照出列的顺序依次输出编号。同时出列编号中间用减号“-”连接。
-Known n individuals sitting at a round table, the first person from a number k clockwise starting from a report number, 1, 2, 3, ..., note the number of clockwise to m that person, but from number k people began to count off counterclockwise, 1, 2, 3, ..., count to m later, two people out of the line. Then the next person from out of the line and from a bi-reported the number of starts to proceed, the number to m that two people out of the line, .... So repeated until all the people around the round table columns. Until the round table was only one man so far. Enter n, k, m output columns in the order in accordance with the output number. While the column numbers separated by a minus sign " -" connection.
输入
n,k,m
输出
按照出列的顺序依次输出编号。同时出列编号中间用减号“-”连接。
-Known n individuals sitting at a round table, the first person from a number k clockwise starting from a report number, 1, 2, 3, ..., note the number of clockwise to m that person, but from number k people began to count off counterclockwise, 1, 2, 3, ..., count to m later, two people out of the line. Then the next person from out of the line and from a bi-reported the number of starts to proceed, the number to m that two people out of the line, .... So repeated until all the people around the round table columns. Until the round table was only one man so far. Enter n, k, m output columns in the order in accordance with the output number. While the column numbers separated by a minus sign " -" connection.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
001 双向约瑟夫问题.cpp