登录
首页 » 数据结构 » 一种基本算法! 现有一个酒店有100个房间,依次编号为1到100,第一个服务员经过,将所有房间门关上;第二个服务员经过将所有编号为2的倍数房门打开;第三个服务员...

一种基本算法! 现有一个酒店有100个房间,依次编号为1到100,第一个服务员经过,将所有房间门关上;第二个服务员经过将所有编号为2的倍数房门打开;第三个服务员...

于 2022-03-24 发布 文件大小:4.88 kB
0 346
下载积分: 2 下载次数: 1

代码说明:

一种基本算法! 现有一个酒店有100个房间,依次编号为1到100,第一个服务员经过,将所有房间门关上;第二个服务员经过将所有编号为2的倍数房门打开;第三个服务员经过将所有编号为3倍数的房门打开的关上,关闭的打开。依此类推;输入一个100以内的正整数N,输出第N服务员经过之后,所有房间的状态。-a basic algorithm! An existing 100 hotel rooms, followed by No. 1-100, after an attendant, all rooms will be closed; Second attendants after all No. 2 in multiples door open; Third attendants after all No. 3 multiples of the open door is shut, Guan the opening closed. XII; The importation of a hundred within the positive integer N, N output after attendants, all rooms in the state.

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • vehicle insurance management
    用于车辆保险维修。在公路边,许多车辆都要保存一个记录,以便为特定的自行车盗窃和事故投保
    2022-02-01 13:38:50下载
    积分:1
  • 一个数据结构的课程设计
    一个数据结构的课程设计-a data structure of the curriculum design
    2022-01-28 13:44:47下载
    积分:1
  • 拖动开发代码,关于pb 的
    拖动开发代码,关于pb 的-Drag code on the pb
    2022-07-10 11:04:39下载
    积分:1
  • 基于算法的标题设置教案ACM算法。文件算法设计
    ACM算法题集 基础算法教案.doc 算 法 设 计 题 集.doc 算法题集.doc-ACM algorithm based on algorithms title set lesson plans. Doc algorithm design problem sets. Doc title set algorithm. Doc
    2023-06-06 15:10:03下载
    积分:1
  • 篮球赛抽签系统,先输入球队数,由随机函数在1
    篮球赛抽签系统,先输入球队数,由随机函数在1-N抽取一个数,作为初始密码,出列第一支球队,然后根据各队输入本队密码,利用joseph环,使每次出列的球队密码作为新的密码,直到所有球队出列,即可确定分组顺序-Basketball lottery system, first enter the team number by the random function in the 1-N taken a number, as the initial password, the first teams out of the column, and then each team enter the team password, using joseph ring, so that each second team out of the column as a new password password, until all the teams out of the column, you can determine the packet sequence
    2022-02-03 18:33:48下载
    积分:1
  • 平滑转弯走迷宫
    顺滑转弯,可以极大程度上减少电脑鼠在迷宫转弯时的损耗时间。本设计讨论电脑鼠底层驱动算法中有关电脑鼠 转弯部分(90度转弯)的改进算法,该方法改进了以往在电脑鼠转弯过程中首先对左右两个电机同时制动, 然后一个电机正向转动,一个反向转动,从而形成电脑鼠转弯过程的传统方法。 本设计所用的方法是在转弯过程中电机不停转,在转弯过程中让一个电机处于减速状态, 另一个处于加速状态(但不停机),然后调整步进电机的步数,使两个电机同时前向转动, 接着调整步进电机在转弯时的步数,待转弯结束后再使电机处于加速状态,并进入前进状态
    2022-01-30 15:52:34下载
    积分:1
  • 这是我在英国的C语言导师自己所写的一个二叉树的程序。
    这是我在英国的C语言导师自己所写的一个二叉树的程序。-This is a binary-tree programme written by my tutor in England.
    2022-12-04 10:50:02下载
    积分:1
  • 广义表的头文件简单实用,一般般的操作都有说明。
    广义表的头文件简单实用,一般般的操作都有说明。-Generalized table header file is simple and practical, generally have been described as the operation.
    2023-04-05 08:15:03下载
    积分:1
  • windows下各种数据转换工具,能转换各种库
    windows下各种数据转换工具,能转换各种库-windows under various data conversion tools, can change all the
    2022-01-26 06:59:16下载
    积分:1
  • 使用powerbuilder开发的小型图书店系统。请查阅!
    使用powerbuilder开发的小型图书店系统。请查阅!-Use PowerBuilder to develop small-scale map Bookstore. Please check!
    2022-03-18 07:27:03下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载