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

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

于 2022-01-24 发布 文件大小:1.41 kB
0 435
下载积分: 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 my series of the experimental temperature and pressure control, can be o...
    这是我编的温度压力控制实验,可以通过开启或关闭风扇来加热或降温。并画出曲线,超出范围报警-This is my series of the experimental temperature and pressure control, can be opened or closed to fans heating or cooling. And he painted curves beyond Alarm
    2022-03-25 06:44:11下载
    积分:1
  • 一个计算器 用VB写的 用的是和XP一样的界面
    一个计算器 用VB写的 用的是和XP一样的界面-a calculator with VB write and use the same interface XP
    2022-04-20 22:29:59下载
    积分:1
  • TEC
    在TEC―2教学机上扩展出如下几条指令,包括确定指令格式和具体内容,指令执行步骤,每一步的操作功能和控制信号等,最后在教学计算机上真正实现出来,调试正确并应用在要求的程序设计中。 要求扩展的指令: ⑴ 比较两个无符号数,并根据比较的记过转移 ① 高于或等于则转移 ② 低于或等于则转移 程序设计要求: 按收键入的n个数据,排序后显示在屏幕上。按键选择下列排序方式: ⑴无符号数排升序 ⑵无符号数排降序-the TEC-2 aircraft to expand teaching the following several directives, including the identification of specific instruction format and content of instruction execution steps, each step of the operation function and control signals, the last in teaching computer truly realize, debug and correct application of the requirements of the program design. The request to expand the order : 1 compared with two symbols, and a comparison under the demerits transfer greater than or equal to a transfer less than or equal to a transfer of program design requirements : by the admission of n-type data sequentially on the screen. Click the following Sort : 1 unsigned row ascending 2 unsigned row descending
    2023-08-16 11:30:04下载
    积分:1
  • 本地端口使用
    C#查看本地端口使用情况,winform的,可以很清楚的看到本地计算机的端口使用情况。
    2022-04-21 04:42:14下载
    积分:1
  • ini adalah program untuk menyimpan data lewat mmc dengan mikrokontroller
    ini adalah program untuk menyimpan data lewat mmc dengan mikrokontroller
    2023-02-21 02:50:04下载
    积分:1
  • 利用C++Builder5.0编写的一个音频录放音程序
    利用C++Builder5.0编写的一个音频录放音程序-The use of C++ Builder5.0 prepared an audio recording and sound procedures
    2023-05-03 18:00:07下载
    积分:1
  • 一个用在手机上的实时语音采集类封装(包含使用说明)
    一个用在手机上的实时语音采集类封装(包含使用说明)-One used in real-time voice on the phone Packaging Acquisition category (including the use of explanation)
    2022-01-24 17:31:28下载
    积分:1
  • SNS source of foreign revenue socialengine shop plug
    国外开源SNS socialengine的商店插件。-SNS source of foreign revenue socialengine shop plug-in.
    2022-02-12 02:21:23下载
    积分:1
  • 三菱PLC程序文件PMW格式转换为文本文件,便于PLC程序转换移植。坚持只有谦虚学习才能真正中国造!...
    三菱PLC程序文件PMW格式转换为文本文件,便于PLC程序转换移植。坚持只有谦虚学习才能真正中国造!-PMW File Convert
    2023-01-23 13:15:03下载
    积分:1
  • build environment : VC6.0 and above reader Sector (byte or word reader) to read...
    编译环境:VC6.0及以上版本 读写扇区(以字节或字读取) 读写簇(以字节或字读取) 读取FAT项 获取BPB信息 获取某文件或文件夹的目录项信息(入口簇及偏移量) 设置目录项信息(可以通过这来实现更改文件名,文件属性,创建时间等信息)-build environment : VC6.0 and above reader Sector (byte or word reader) to read and write Cluster (byte or word reader) to read FAT items BPB access information access a document or folder directory information items (imported cluster and offset) the installation of Contents items (which can be passed to to achieve change file names, file attributes, create time information)
    2022-11-14 19:55:03下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载