登录
首页 » 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 116
下载积分: 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 个回复

  • IOaUART
    利用单片机IO口模拟UART程序,系统用了一个定时器和一个外部中断,外部中断主要是用来检测串口起始位的到来。(IO mouth simulation UART program, microcontroller system with a timer and an external interrupt, external interrupt is mainly used to detect the arrival of the start bit serial port.)
    2016-12-30 08:38:34下载
    积分:1
  • stm32f103 ADS1256
    说明:  ads256驱动,实现ad采样及转换功能(Ads256 driver, realize AD sampling and conversion function)
    2021-04-19 16:39:10下载
    积分:1
  • ADAPTC
    自适应滤波,利用C语言实现该功能,调试正确(Adaptation using LMS)
    2011-09-06 16:20:37下载
    积分:1
  • 程序设计中基于构造函数的对象初始化方法研究
    说明:  c++程序设计时声明对象时,通过使用构造函数,可以实现对象的初始值.(When declaring an object in c++ programming, the initial value of the object can be achieved by using constructors.)
    2019-05-04 19:57:09下载
    积分:1
  • MuteHook
    说明:  Hook进程静音,是非常好的代码,大家留意了(Hook process mute, is a very good code, you notice)
    2020-06-22 16:00:01下载
    积分:1
  • vc6 读取 shp文件
    使用vc6.0 shplib库读取shp文件
    2017-01-10下载
    积分:1
  • C# 热键模拟 模拟数字输入、英文输入Home键、Backspace键
    C#通过窗体的按钮来模拟按下键盘上指定键的功能,比如模拟出了Shift+Home、Delete、Enter、Home、Backspace、数字输入、英文输入等键的功能,相关功能模块代码如下,可自己添加相关的模块功能键:   private void button3_Click(object sender, System.EventArgs e)   {//Backspace空格键    this.richTextBox1.Focus();    SendKeys.Send("{Backspace}");   }   private void button4_Click(object sender, System.EventArgs e)   { //End结束键    this.richTextBox1.Focus();    SendKeys.Send("{End}");   }   private void button5_Click(object sender, System.EventArgs e)   {//Home键    this.richTextBox1.Focus();    SendKeys.Send("{Home}");   }   private void button6_Click(object sender, System.EventArgs e)   {//Enter回车键    this.richTextBox1.Focus();    SendKeys.Send("{Enter}");   }   private void button7_Click(object sender, System.EventArgs e)   {//Delete删除键    this.richTextBox1.Focus();    SendKeys.Send("{Delete}");   }
    2022-07-19 00:15:03下载
    积分:1
  • MakeImage
    说明:  全志平台image做头工具,用于生成校验信息,连接BootLoader和APP镜像(sunxi arm cpu image tool)
    2020-02-05 17:47:43下载
    积分:1
  • longgekuta
    系统仿真导论第一个实验程序,龙格库塔实验程序(Introduction The first experimental system simulation program, Runge-Kutta experimental procedures)
    2013-06-28 19:12:31下载
    积分:1
  • tuxiangjiami
    此程序用于加密图像,给出已有图像,将混沌序列与图像通过加密算法进行结合得到密文,再进行解密。(This program is used to encrypt the image, give the existing image, combine the chaotic sequence with the image through the encryption algorithm to obtain the ciphertext, and then decrypt it.)
    2018-04-25 14:46:08下载
    积分:1
  • 696516资源总数
  • 106658会员总数
  • 16今日下载