文件名称:001shuangxiangyuesefu
-
所属分类:
- 标签属性:
- 上传时间:2013-06-16
-
文件大小:895byte
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
已知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
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.