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

  • weixingdingwei
    作者在学习《航天系统》时,在c++6.0环境中实现的卫星定位的算法程序。包括通过轨道根数求卫星状态参数的算法和通过卫星状态参数反求卫星星历的算法。(Author of the study "space system" is in c++6.0 environment to achieve the satellite positioning algorithm. Including through the orbital parameters of the algorithm for the satellite status and Reverse status parameters via satellite satellite ephemeris algorithms.)
    2013-09-25 19:42:10下载
    积分:1
  • 7.4
    说明:  用VC++6.0编写的一个类似RM的播放器程序(Using VC++6.0 prepared in a similar RM player program)
    2010-03-18 10:25:39下载
    积分:1
  • test proba hatha mukodik
     ******************************************************************************
    2023-06-23 08:55:03下载
    积分:1
  • GenericCPPLib-master
    enables specific handling of four-digit numbers with non-zero hundreds: they are often named using multiples of hundred AND combined with tens AND/OR ones ( one thousand one , eleven hundred three , twelve hundred twenty-five , four thousand forty-two , or ninety-nine hundred ninety-nine etc)
    2016-05-28 16:00:24下载
    积分:1
  • nrf24l01ceshi
    程序主要实现了无线模块nrf24l01传输温度的,功能。(Program achieved a major wireless module nrf24l01 transmission temperature function.)
    2014-01-20 17:04:17下载
    积分:1
  • ACM
    计算单源最短路径 基于dijkstra的配对堆优化 附赠kuangbin的算法模板(Optimizing the Matched Reactor Based on Dijkstra for Calculating the Shortest Path of Single Source Algorithmic Template with Kuangbin)
    2020-06-24 01:40:02下载
    积分:1
  • pcap_dnsproxy-master
    pcap 截获dns 的一个示例DEMO 。可以下载来学习一下(pca dnsnsdflk)
    2014-08-19 09:45:29下载
    积分:1
  • xinheike
    宁俊明编写的新黑客点击实战教程 宁俊明编写的新黑客点击实战教程 宁俊明编写的新黑客点击实战教程 (Ning Junming Click combat hackers write new tutorials Ningjun Ming prepared a new tutorial Ningjun Ming actual preparation of hacker hits new combat tutorial hacker hits)
    2010-09-07 16:37:18下载
    积分:1
  • 小车
    基于Blinker的手机控制小车。硬件:arduino(Mobile control car based on Blinker.Hardware:arduino)
    2020-06-16 05:20:02下载
    积分:1
  • 注册表操作之开机祝福
    注册表操作之开机祝福,一个简单的注册表操作demo
    2022-03-01 12:05:14下载
    积分:1
  • 696516资源总数
  • 106442会员总数
  • 11今日下载