登录
首页 » Windows开发 » 编号为1,2,…,n的n个人按顺时针方向围坐一圈,每人持有一个密码(正整数),一开始人选一个正整数作为报数上限m,从第一个人开始按顺时针方向从自1开始顺序报数,...

编号为1,2,…,n的n个人按顺时针方向围坐一圈,每人持有一个密码(正整数),一开始人选一个正整数作为报数上限m,从第一个人开始按顺时针方向从自1开始顺序报数,...

于 2022-01-24 发布 文件大小:1.41 kB
0 414
下载积分: 2 下载次数: 1

代码说明:

编号为1,2,…,n的n个人按顺时针方向围坐一圈,每人持有一个密码(正整数),一开始人选一个正整数作为报数上限m,从第一个人开始按顺时针方向从自1开始顺序报数,报道m时停止报数。报m的人出列,将他的密码作为新的m值,从他的顺时针方向上的下一个人开始重新从1报数,如此下去,直至所有人全部出列为止,设计一个程序求出出列顺序。采用单向循环链表模拟此过程,按照出列的顺序印出各人的编号测试数据:m的初值为20;n=7,7个人的密码依次为:3,1,7,2,4,8,4,首先m的值为6(正确的出列顺序应为6,1,4,7,2,3,5)-No. 1, 2, ..., n n clockwise direction by individuals sitting around a circle, each holding a password (positive integers), a candidate started as a positive integers m ceiling on the number of reported from the first individuals to embark on the clockwise direction from the start sequence from a few newspaper reports m reportedly stopped a few. M reported out of the list of his password as a new value m, from the clockwise direction on the next re-started from a few reported so on, until all out all out, the design of a procedure sought out the order out. Listless one-cycle simulation process and follow the sequence shown in the numbers printed each test data : m for the initial 20; N = 7,7 personal passwords were : 3,1,7,2,4,8

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

发表评论

0 个回复

  • 英文主源代码,附录的源代码
    《英文版掌握Vc++》附录中的源代码-"English master Vc" appendix of source code
    2022-08-10 00:14:19下载
    积分:1
  • 自我管理汽车
    这份文件题为来自Kioskea«自我管理»(来源代码)下之条款下提供Creative Commons许可。您可以复制,修改此份源,规定的许可的条件下,作为本说明
    2022-10-09 10:55:03下载
    积分:1
  • 8拼图使用DFS C++代码
    本文用bfs解决了c++中的8个益智游戏
    2022-09-18 23:00:04下载
    积分:1
  • VC里rasdial拨号源代码,绝对好用,有回调
    VC里rasdial拨号源代码,绝对好用,有回调-VC Lane rasdial dial-up source code, absolutely everything, is a callback
    2022-03-24 16:23:37下载
    积分:1
  • FRID
    FRID读写器开发FRID读写器开发FRID读写器开发FRID读写器开发FRID读写器开发FRID读写器开发FRID读写器开发FRID读写器开发FRID读写器开发
    2022-08-10 00:46:36下载
    积分:1
  • 攀登网
    水管工源码,包括图形以及AI部分源代码,供初学者使用!-Scrambled Net
    2022-03-23 09:27:46下载
    积分:1
  • A simple tool which clears all the Windows eventlogs
    A simple tool which clears all the Windows eventlogs
    2022-03-05 11:58:36下载
    积分:1
  • 仿windows计算器运行程序 和漂亮的
    仿windows计算器运行程序 和漂亮的-仿windows计算器运行程序
    2022-06-18 22:54:02下载
    积分:1
  • 通信系统传输模型
    这是信息论与编码的作业,有3种信源编码方式,费诺编码、唯一可译码、香农码。 唯一可译码:若码的任意一串有限长的码符号序列只能被唯一地译成所对应的信源符号序列,则此码称为唯一可译码,否则,就称为非唯一可译码。 香农码:按不等式选择的码长所构成的码称香农码,香农码满足克拉夫特不等式。
    2022-05-09 14:36:43下载
    积分:1
  • 这是一份完整的记事本测试文档,内含详细测试步骤已经规范的格式,可作学习参考之用...
    这是一份完整的记事本测试文档,内含详细测试步骤已经规范的格式,可作学习参考之用-This is a complete test Notepad document, containing detailed steps have been standardized test format, can be used for study and reference
    2022-03-03 13:25:38下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载