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

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

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

  • 用栈解决迷宫问题,随机生成迷宫,而且还调用了 windows.h 实现了 windows 控制台字体变化,采用C++实现,注释很详细...
    用栈解决迷宫问题,随机生成迷宫,而且还调用了 windows.h 实现了 windows 控制台字体变化,采用C++实现,注释很详细-Find a way through a maze with stack. The maze is generated randomly. Change the colors in console. Use C++ with detailed comments.
    2023-02-01 05:55:03下载
    积分:1
  • Data structure the curriculum design, and this is our last to hand over the curr...
    数据结构课程设计,这是我们的最后要上交的课程设计,做的较认真,代码有详细中文解释-Data structure the curriculum design, and this is our last to hand over the curriculum design, to do more serious, detailed English explanation of the code
    2022-07-02 22:55:53下载
    积分:1
  • 设计一个项目,排出AOE网络,并将输入计算机,用程序进行分析。...
    设计一个项目,排出AOE网络,并将数据输入计算机,用程序进行分析。-Design a project, from AOE network, and data entered into the computer, using the procedure for analysis.
    2022-05-07 23:26:23下载
    积分:1
  • 用VB编写的汉诺塔演示程序创建图形界面的汉诺塔问题,..
    汉诺塔演示程序,用VB做成的图形界面,能够实现汉诺塔问题,也即是把N个盘子从一根棍上移到另一根上面,通过中转的棍,但是必须保证在每根棍上都是下面的盘子大于上面的盘子。-HANOR demo program using VB create graphical interface to HANOR problems, that is, N dishes from one club to another on the above-through the interchange stick, but it must be guaranteed in each stick-on the following dishes are greater than the above dishes.
    2022-05-08 05:57:47下载
    积分:1
  • 紧凑型房
    小巧的天气预报实时显示系统,采用GDI+技术开发,实现了基本且简单的功能,能在图片上实时显示温度/气温等天气预报情况,并能进行数据的维护更新。小巧的天气预报实时显示系统,采用GDI+技术开发,实现了基本且简单的功能,能在图片上实时显示温度/气温等天气预报情况,并能进行数据的维护更新。-compact real-time weather display system using GDI technology development, achieve the basic and simple functions, in real-time pictures show that the temperature/weather conditions such as temperature, and for the maintenance and update of data. The compact, real-time weather system, using GDI technology development, achieve the basic and simple functions, in real-time pictures show that the temperature/weather conditions such as temperature, and for the maintenance and update of data.
    2022-01-27 21:00:08下载
    积分:1
  • This is a beginner's book for the past programming white cases are different...
    这是初学者的宝典,以以往的编程白例是不同的,有较大的区别,里面有100多个编程实例-This is a beginner"s book for the past programming white cases are different, the difference is larger, there are more than 100 examples of programming
    2022-09-05 14:00:03下载
    积分:1
  • A memory database system writing by a Russian with good reference worth.
    一个俄国人写的内存数据库系统,非常具有参考价值-A memory database system writing by a Russian with good reference worth.
    2022-10-30 09:50:02下载
    积分:1
  • Online chat room system, this system development environment and myeclipse datab...
    网上聊天室系统,本系统采用myeclipse开发环境和sqlserver2000数据库。-Online chat room system, this system development environment and myeclipse database sqlserver2000.
    2022-10-25 16:45:03下载
    积分:1
  • 在线考试系统
    在线考试系统是为不同学生提供在线考试。 使用 PHP 构建,  wamp 服务器包含登录表单,注册表单, 和数据库维护,可以删除或者插入数据
    2022-01-30 21:57:38下载
    积分:1
  • ADO操作库强大封装类
    MySql,Access ADO操作数据库强大封装类 功能满足大家的需求 C++源码,有需要的下载吧
    2023-01-23 09:15:04下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载