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

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

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

  • 转换为sql语句
    讲sql中的语句转为C#中使用的语句,也可以转换为大写字母或者小写字母,方便查看,其中有一个输入框,一个输出框,三个按钮,是winfrom
    2022-02-22 10:16:36下载
    积分:1
  • C++ with self
    C++用自写的List链表以及面向对象的思想写成的图书管理系统,实现了文件读写记录-C++ with self-written list of the List, as well as the idea of object-oriented management system written in books, reading and writing a paper record
    2022-03-31 15:51:50下载
    积分:1
  • gfdg en dfdf lgdfk dfsf dfhsf
    dfgfdgddescription(英文):(提示:至少100)
    2022-08-22 07:58:40下载
    积分:1
  • Bluetooth demo Windows CE Bluetooth application sample
    蓝牙wince测试demo Windows CE Bluetooth application sample-Bluetooth demo Windows CE Bluetooth application sample
    2022-08-21 11:24:01下载
    积分:1
  • windows c++源代码
    这是初学VC++基本实例,从简单的语法实例到复杂的窗口程序,希望对初学者有帮助。windows c++源代码.zIP压缩文件.
    2022-03-24 12:37:39下载
    积分:1
  • 销售和库存管理系统
    模块包括: 销售 用户注册 库存管理 报告
    2022-07-18 09:55:18下载
    积分:1
  • 使用c++编写的Pos机前台程序。自带小型汉字库,可在控制台上直接运行...
    使用c++编写的Pos机前台程序。自带小型汉字库,可在控制台上直接运行-use Pos c prepared by the procedures for the future. Store bringing their small, the console directly operation
    2022-08-09 02:55:41下载
    积分:1
  • vc 的多线程例子
    vc 的多线程例子-vc multithreading example
    2022-04-17 12:55:08下载
    积分:1
  • "electronic mapping system components" implementation : a CD
    “电子元器件绘制系统”执行说明: 1、 光盘目录vc6.0chapter2inDrawChip.exe为本系统的可执行文件。 2、 光盘目录vc6.0chapter2srcDrawChip*.*为本系统的VC源程序。 “电子元器件绘制系统”如何编译: 直接编译,生成的可执行文件放在 vc6.0chapter2in目录下,名称为DrawChip.exe。-"electronic mapping system components" implementation : a CD-ROM directory vc6.0 chapter2 bin DrawChip.exe-based system of the executable. 2, CD-ROM directory vc6.0 chapter2 src DrawChip *.*-based system of VC source. "Electronic Components Rendering System" How compiler : direct compiler, generating executable files on vc6.0 chapter2 bin directory under the name of DrawChip.exe.
    2022-03-22 07:02:09下载
    积分:1
  • PMS命令生成器
    PMS命令生成器,简单的命令生成工具。 PMS command generator, simple command generation tool.
    2022-08-16 13:43:56下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载