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

  • 1616
    把十六进制数转换为十进制数,简单方便!能用于串口通信数据处理中(The hexadecimal number is converted to a decimal number, is simple and convenient! Can be used for serial communication data processing)
    2008-03-09 14:37:30下载
    积分:1
  • elgamal
    this is el gamal algorithm, you can download it if you want.
    2020-11-26 16:19:31下载
    积分:1
  • 华为技术有限公司c语言编程规范.pdf
    华为的代码规范,C语言版,适合嵌入式行业的工程师(Code regulation used in HUAWEI, C language version.)
    2021-02-22 19:59:41下载
    积分:1
  • MARK_Dehaze
    2009年CVPR最佳论文《Single image haze removal using dark channel prior》暗原色图像去雾的算法实现。与原文不同的是本程序没有完成最后matting细化效果的部分,但仍能够达到视觉上可以接受的去雾效果。计算机视觉课程作业。工程运行于VS2008环境,需要OpenCV支持。Debug目下exe文件可以直接双击运行查看结果。(CVPR 2009 Best Paper " Single image haze removal using dark channel prior" to the dark fog of the primary image algorithm. The difference is that with the original program did not complete the final matting refinement part,yet haze-removal result is visually acceptable. Visual course work. This project runs under VS2008 with OpenCV. Double click the exe file under Debug folder to check the final result.)
    2011-08-10 16:46:35下载
    积分:1
  • 动态设置IP地址
    动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址动态设置IP地址
    2023-05-07 18:25:02下载
    积分:1
  • can总线入门与实践
    基于51单片机的CAN总线系统设计为讲解对象,在内容安排上兼顾理论与实践,循序渐进地将其呈现给读者。第1—3章主要讲述CAN总线底层协议规范、应用层协议以及CAN总线控制器和驱动器,为CAN总线系统设计奠定基础。第4—9章重点讲解CAN总线系统硬件设计和程序设计,以帮助读者熟悉该系统的硬件资源,也是单片机学习者很好的学习范例;同时给出CAN总线自发收、两点通信、多点通信、CAN—RS232网桥、温控系统等综合实例,让读者在学习和实践中理解CAN总线的精髓。最后一章与读者分享作者的一些设计感悟,并对网友常见问题进行解答.
    2022-02-28 18:41:41下载
    积分:1
  • 点云数据处理
    LASTOOLS is a set of individual command line tools that process data stored in LAS format.  Written by Martin Isenburg, these tools are an efficient way to perform an assortment of  conversion, reformatting and data inspection workflows. This document presents a variety of  examples and scenarios that show how you can use LASTOOLS to work with the LAS files you  download from the State of Minnesota LiDAR ftp site (lidar.dnr.state.mn.us). 
    2022-03-10 11:18:56下载
    积分:1
  • 1588协议实现
    1588协议C语言实现,主要是用于网络之间进行时间时钟同步;1588协议C语言实现,主要是用于网络之间进行时间时钟同步;1588协议C语言实现,主要是用于网络之间进行时间时钟同步;1588协议C语言实现,主要是用于网络之间进行时间时钟同步;1588协议C语言实现,主要是用于网络之间进行时间时钟同步;1588协议C语言实现,主要是用于网络之间进行时间时钟同步
    2022-09-14 18:10:03下载
    积分:1
  • znfatstm32
    znfat的STM32的移植的范例 非常好用
    2010-07-04 12:51:53下载
    积分:1
  • ad7710
    24位高精度A转换芯片 AD7710 源码 已成功用于液压自动控制系统五年(24 high-precision A conversion chip AD7710 source has been successfully used for hydraulic automatic control system for five years)
    2008-08-11 15:52:04下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载