登录
首页 » C# » 【问题描述】 设有n个人围坐在圆桌周围,现从某个位置m(1≤m≤n)上的人开始报数,报数到k的人就站出来。下一个人,即原来的第k+1个位置上的人,又从1开始报数...

【问题描述】 设有n个人围坐在圆桌周围,现从某个位置m(1≤m≤n)上的人开始报数,报数到k的人就站出来。下一个人,即原来的第k+1个位置上的人,又从1开始报数...

于 2022-07-01 发布 文件大小:2.05 kB
0 130
下载积分: 2 下载次数: 1

代码说明:

【问题描述】 设有n个人围坐在圆桌周围,现从某个位置m(1≤m≤n)上的人开始报数,报数到k的人就站出来。下一个人,即原来的第k+1个位置上的人,又从1开始报数,再报数到k的人站出来。依此重复下去,直到全部的人都站出来为止。试设计一个程序求出出列序列。 这是一个使用循环链表的经典问题。因为要不断地出列,采用链表的存储形式能更好地模拟出列的情况。-[n-- with the individuals sitting around the round table is from a certain location m (1 m n) of people reported the number of reported number of people who have come out. Next individuals, that the original clause k a position who reportedly started from a few, and reported that the number of people who come forward. Accordingly continue to repeat until all of the people come out so far. Test procedures designed sought out a sequence out. This is a use of recycled Chain classic problem. Due to the constant up and be using the storage form of Chain better simulate down.

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • DAB
    双有源桥DC-DC高频隔离变压器的Simulink仿真,实现稳定的输出电压,采用SPS移相调制(Simulink simulation of double active bridge DC-DC high-frequency isolation transformer for stable output voltage using SPS phase-shift modulation)
    2021-01-10 11:08:51下载
    积分:1
  • lwip RAW_TCP客户端源码
    说明:  lwip移植加tcpip客户端功能代码,在ucos系统基础上移植lwip,并使用raw接口进行客户端服务编写(Lwip transplantation plus tcpip client function code)
    2020-07-20 13:49:13下载
    积分:1
  • DXFLibrary-master
    说明:  定义了不同cad图元属性,方便生成cad实体类(Constructs cad Entity with minimal arguments.)
    2020-06-24 16:00:01下载
    积分:1
  • RC_A7128_x3 Reference code
    说明:  AMICCOM的A7128 433芯片驱动(AMICCOM A7128 433 Chip Driver)
    2019-06-18 23:40:47下载
    积分:1
  • Four-phase-stepper-motor
    控制四相步进电机。。。。。。。。 可使电机正转和反转(Four-phase stepper motor control)
    2013-07-31 10:21:31下载
    积分:1
  • 一个很好用滚动控件,用户可自行拓展的控件。
    一个很好用滚动控件,用户可自行拓展的控件。-rolling with a very good control, users can develop the self-control.
    2022-05-06 18:25:38下载
    积分:1
  • MouseClickPMFC
    能够完成鼠标的自动点击,可以使电脑在五人看守的情况下,某些系统不再掉线。(Automatically clicks the mouse to complete, you can make your computer in case of five guards, some systems are no longer dropped.)
    2014-07-06 18:22:52下载
    积分:1
  • SOUCE
    SI4730源代码,STC89C516CPU驱动,1602显示屏对SI47XX系列调试有很大帮助(SI4730 source code, STC89C516CPU drive, display 1602 pairs of SI47XX series of great help to debug)
    2010-02-02 19:00:34下载
    积分:1
  • 87409871
    自动编写SQL插入存储过程的源程序,很好(Automatically write SQL insertion of the stored procedure source code, very good)
    2017-07-13 16:42:42下载
    积分:1
  • minigis小程序显示并可查询省会坐标(内附地图数据信息txt格式)
    minigis小程序显示并可查询省会坐标(内附地图数据信息txt格式)。
    2022-06-13 14:47:16下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载