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

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

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

  • meteoinfo Demo
    MeteoInfo是一个免费、开源的气象数据显示、分析软件,具有较强的综合数据图形显示、分析能力,操作简便、图形美观。软件支持多种常用气象数据格式,具备一些基本的GIS功能。MeteoInfo还可以通过编脚本程序自动运行,具备强大的数据分析功能。MeteoInfo的核心功能封装在类库中,使用该类库可以方便快捷地开发气象数据显示分析类软件。目前MeteoInfo分别由两种语言开发:Java和C#,二者的功能和用法类似,Java版具备很强的跨平台能力,是今后发展的重点。
    2022-01-25 14:15:36下载
    积分:1
  • 《精通正则表达式》第三版英文pdf版,高级程序员必读。
    《精通正则表达式》第三版英文pdf版,高级程序员必读。- Proficient in the regular expression the third edition of the English pdf version of must-read high-level programmers.
    2022-01-25 21:37:49下载
    积分:1
  • 用 VB 做的一个 232
    用 VB 做的一个 232-485 抄表程式(上海04版),还有其它的(hz218@sina.com) -This program is used for 232-485 writting form(Shang Hai 04 version) and written by VB language, other version please contact my email address.(hz218@sina.com)
    2022-01-26 07:43:25下载
    积分:1
  • 物体识别
    该程序是一个通用的、可训练的系统,用于在无约束、杂乱的场景中进行目标检测。
    2022-02-10 08:08:46下载
    积分:1
  • 刚学JAVA的时候老师布置的作业,一个简单的小JAVA程序,关于学生信息的.主要目的是接触JAVA....
    刚学JAVA的时候老师布置的作业,一个简单的小JAVA程序,关于学生信息的.主要目的是接触JAVA.-just learning the layout of the teachers work, a simple small Java procedures, information on the students. The main purpose is to contact JAVA.
    2022-07-27 10:33:21下载
    积分:1
  • ResizeSplitter控件(VC对话框用)
    做工程时写的自定义控件, 1、ResizeSplitter,实现Dialog大小调整时,其内的控件大小及位置动态调整,准备发表到CodeProject上去的,呵呵。 2、自定义Edit控件文本显示,自定义背景色,目前还未实现输入,后期打算写语法编辑控件;
    2022-03-21 07:22:12下载
    积分:1
  • 用vc调用matlab7.0编写的小程序,可以实现简单的控制系统…
    用vc调用matlab7.0写的小程序,可以实现简单的控制系统仿真演示-with vc call matlab7.0 write small programs, can achieve a simple control system simulation demo
    2022-09-03 08:15:03下载
    积分:1
  • 中科主机系统ASP.NET版v0.2.rar
    中科主机系统ASP.NET版v0.2.rar-Branch mainframe systems which version of ASP.NET v0.2.rar
    2023-05-24 22:30:04下载
    积分:1
  • 精通正则表达式是最权威的讲解正则表达式的书籍,讲解全面细致而且易于理解,所举例子更是生动...
    精通正则表达式是最权威的讲解正则表达式的书籍,讲解全面细致而且易于理解,所举例子更是生动-Versed in regular expressions is the most authoritative books that explain the regular expressions to explain the detailed and thorough and easy to understand, the more vivid examples
    2022-05-19 02:51:56下载
    积分:1
  • 在WINCE下TCP/IP网络程序源码
    在WINCE下TCP/IP网络开发程序源码-WINCE under the TCP/IP network development process FOSS
    2022-04-22 04:56:00下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载