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

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

于 2022-01-24 发布 文件大小:1.41 kB
0 353
下载积分: 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 个回复

  • 资源管理器
    Delphi开发的资源管理器,本程序采用shelltreeview实现windows系统文件的浏览、添加、删除、查看功能,跟windows自身资源管理器很类似!
    2023-02-09 15:15:03下载
    积分:1
  • 枚举局域网内计算机
    枚举局域网内计算机-enumeration computer LAN
    2022-03-01 06:07:08下载
    积分:1
  • 经典的IOCP文件读写代码
    经典的IOCP文件读写代码-classic IOCP document literacy code
    2022-07-21 15:48:45下载
    积分:1
  • ImageEn控件Demo,需要先安装ImageEn控件
    ImageEn控件Demo,需要先安装ImageEn控件-ImageEn Control Demo, need to install control ImageEn
    2023-04-30 20:40:03下载
    积分:1
  • 消去法求解线性方程组。 MFC做的可视化界面。
    消去法求解线性方程组。 MFC做的可视化界面。-Elimination method for solving linear equations. MFC to do visual interface.
    2022-01-22 14:27:56下载
    积分:1
  • 一套完整的飞机大战代码!Java
    模仿微信游戏飞机大战,原汁原味还原该游戏程序。本包是一整套游戏代码,包括设计的图片,直接使用eclipse将该项目导入即可试玩。如果想深入学习打开Java文件即可看源码!内有备注,看到哪学到哪!
    2022-03-05 07:50:10下载
    积分:1
  • 工作门户系统
    我想要开发工作门户系统项目还有一些代码,如如何向他们的电子邮件发送消息,如何将截止日期设置为邮政 project.assume ,这是最后一年工程项目必须进行标准化这样请帮我邮寄工作门户的完整代码。
    2022-10-09 20:15:03下载
    积分:1
  • JXTA代码,美丽的排偶癞瓜内
    JXTA代码,美丽的排偶癞瓜内 -JXTA code, beautiful skin disease排偶Guarneri JXTA code, beautiful skin disease排偶Guarneri
    2022-03-17 14:31:19下载
    积分:1
  • database comparison tool to import the database to link more library the same na...
    数据库比较工具,分别输入要连接的数据库,比较库中相同名字的表的字段是否相同,相同表名前会自动打勾,结果得出相同字段有多少,表a比表b多出的字段是什么,少的是什么。-database comparison tool to import the database to link more library the same name of the table if a field is the same as before the same table name will be automatically checked, the outcome of the same field, there is a table Table b more than the field what is what is missing.
    2022-06-27 07:43:34下载
    积分:1
  • server u是一款非常注明的ftp工具,操作简单,非常适合搭建跑、ftp服务器。...
    server u是一款非常注明的ftp工具,操作简单,非常适合搭建跑、ftp服务器。-server u is a highly specified ftp tools, simple operation, very suitable to build run, ftp server.
    2023-06-14 15:46:14下载
    积分:1
  • 696516资源总数
  • 106446会员总数
  • 9今日下载