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

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

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

  • 这是一个用控制台做的螺旋线的动画,帮你改变背景,实现简单动画
    这是一个用控制台做的螺旋线的动画,帮你改变背景,实现简单动画-This is a console to do with the spiral of animation, to help you change the background, the realization of a simple animation
    2022-03-20 02:46:55下载
    积分:1
  • 刻录软件源代码 ename all Files *.rename in the folder to *.dll. After this run the pr...
    刻录软件源代码 ename all Files *.rename in the folder to *.dll. After this run the project and have phun!!! The source for the dll s is included. For the source for aspiburning.dll you need the free compiler "masm32". The source of aspiburning.dll is Assembler, so it s very fast!!! You ll get an error, if you want to overwrite an existing ISO. Visual Basic will crash.-Burning software source code ename all Files*. rename in the folder to*. dll.After this run the project and have phun!!! The source for the dll s is included.For the source for aspiburning.dll you need the free compiler masm32 . The source of aspiburning.dll is Assembler, so it s very fast!!! You ll get an error, if you want to overwrite an existing ISO.Visual Basic will crash.
    2022-01-27 18:10:24下载
    积分:1
  • Jilin University Experimental procedures Computer Graphics bezier curve drawing...
    吉林大学计算机图形学的试验程序 bezier曲线的绘制方法-Jilin University Experimental procedures Computer Graphics bezier curve drawing method
    2022-03-03 17:51:23下载
    积分:1
  • 项目管理信息系统,很完善的系统,包括生产管理,仓库管理,项目管理等信息系统...
    项目管理信息系统,很完善的系统,包括生产管理,仓库管理,项目管理等信息系统-Project management information system, it is a sound system, including production management, warehouse management, project management information system
    2022-03-14 06:31:10下载
    积分:1
  • 906 for one yuan linear regression equation and forecast a function of the varia...
    906 求一元线形回归方程及预报 一 功能 x为自变量,y为随机变量,给出一组n次观测值(Xi, Yi), I=1, 2, … n, 求线形回归方程 Y=A+BX 来描述Y与X的变化规律。并用T检验法检验线形回归是否显著。若显著,可用求得的线形回归方程作预报,并给出预报值的置信区间。 -906 for one yuan linear regression equation and forecast a function of the variable x, y as random variables, is a group of n measurements (Xi, Yi), I = 1, 2, ... n, seeking linear regression equation Y = A BX to describe the X and Y changes in the law. Using T-test whether linear regression significantly. If significant, can be used to compute the linear regression equation for forecasting, and is forecasting value of the confidence interval.
    2022-08-09 19:24:23下载
    积分:1
  • 网吧计费系统软件
    网吧计费系统软件-Internet Billing System Software
    2022-01-28 08:08:43下载
    积分:1
  • 游戏蛇
    我做了使用 c# 的贪吃蛇游戏。它的看起来像向诺基亚 3310 贪吃蛇游戏。。。
    2022-02-03 05:52:27下载
    积分:1
  • This code for find object on the map
    This code for find object on the map
    2022-03-11 13:30:00下载
    积分:1
  • a normal calculator
    实现了一个普通计算器的全部功能,包扩存取数据。-a normal calculator
    2023-03-10 22:15:03下载
    积分:1
  • vb derived IE favorites procedures can learn from it thinking
    vb导出IE收藏夹的程序 可以学学它的思路-vb derived IE favorites procedures can learn from it thinking
    2022-02-02 08:49:54下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载