登录
首页 » C# » Description : Let numbered 1, 2, ..., n (NGT; 0) clockwise direction by individu...

Description : Let numbered 1, 2, ..., n (NGT; 0) clockwise direction by individu...

于 2023-04-25 发布 文件大小:20.54 kB
0 155
下载积分: 2 下载次数: 1

代码说明:

描述:设编号为1,2,…,n(n>0)个人按顺时针方向围坐一圈,每人持有一个正整数密码。开始时任意给出一个报数上限值m,从第一个人开始顺时针方向自1起顺序报数,报到m时停止报数,抱m的人出列,从他在顺时针方向上的下一个人起重新自1起顺序报数;如此下去,直到所有人全部出列为止。要求设计一个程序模拟此过程,并给出出列人的编号序列。 .算法思想: Jeseph函数是实现问题要求的主要函数,其算法思想是:从1至m对带头结点的单循环链表循环计数,到m时,输出该结点的编号值,,再从该结点的下一个结点起重新自1起循环计数;如此下去,直到单循环链表空时循环过程结束。 -Description : Let numbered 1, 2, ..., n (NGT; 0) clockwise direction by individuals sitting around a circle, each holding a positive integer code. At the beginning of a given arbitrary reported few limits on m, started from the first clockwise direction from the starting sequence reported a few, when they report back m reported few, hold out the m out from the clockwise direction in the next personal re-order starting from a newspaper; This situation continues until all people so far shown up. Asked to design a simulation of this process, and give out the number of people out sequence. . Algorithm thinking : Jeseph function is to seek to achieve the main function of the algorithm is thinking : m f

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

发表评论

0 个回复

  • 100EXAMPLE
    100个c#编程的小例子,非常实用,适合初学者使用(100 c# programming small example, very practical,Suitable for beginners)
    2014-12-12 16:47:56下载
    积分:1
  • kk-firmware2.3
    kk飞控的程序,kk飞控是一款低端的很廉价的很好的飞控程序。适合初学者玩多轴飞行器。(kk flight control procedures, kk flight control is a very cheap low-end good fly control program. Suitable for beginners to play multi-axis aircraft.)
    2014-02-01 20:47:14下载
    积分:1
  • stm32红外遥控控制
    使用stm32f013c8t6实现格力空调红外遥控,并实现温度数据的读取,通过wifi将数据进行发送
    2022-08-09 12:38:14下载
    积分:1
  • STM32F103ZET6 的ADC信息采样
    STM32F103ZET6 的ADC信息采样,keil程序,ADC采样,说白了就是采集电压,这个功能是极其重要的,通常的我们的都是对各种传感器采集电压,来进行判断,开环闭环控制,今天,向大家介绍ADC的多通道采样,和DMA的采样方式。DMA的采样方式,可有效节省CMU在ADC的运行时间,提高效率,尤其是在系统构建的时候,必须要考虑好,你的效率问题。
    2022-01-26 04:08:25下载
    积分:1
  • matlab
    是一个语音识别的程序,有LPCC,MFCC等的代码,最后用SVM进行分类(Is a voice recognition program, there LPCC, MFCC and other code, the final classification with SVM)
    2011-09-23 17:05:17下载
    积分:1
  • MC9S12XEP100 D_FLASH
    一款飞思卡尔MC9S12XEP100 D_FLASH 程序编写资料
    2022-02-25 17:12:07下载
    积分:1
  • 通过串口接收数据,并把接收到的数据保存到数据库中
    通过串口接收数据,并把接收到的数据保存到数据库中,
    2022-05-08 15:06:03下载
    积分:1
  • DS18B20LCD
    基于温度传感器DS18B02的应用程序,并在数码管显示,简单易懂。(Temperature sensor DS18B02 based applications, and digital display, easy to understand.)
    2011-07-17 15:20:55下载
    积分:1
  • 中值滤波代码
    通过写中值滤波代码,可以显示中值滤波程序运行结果和保存图片。
    2022-03-02 11:50:50下载
    积分:1
  • 图的一种算法,实现图里所有节点间最短路径,然后输出到一个文件里,即包含输入输出文件,请用test 工作区...
    图的一种算法,实现图里所有节点间最短路径,然后输出到一个文件里,即包含输入输出文件,请用test 工作区-a map algorithm, and all nodes in Ituri between the shortest path, and then output to a file, includes input and output documents, please use the test work area
    2023-05-11 15:45:03下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载