文件名称:light-bulb
- 所属分类:
- 其他小程序
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2014-05-26
- 文件大小:
- 867kb
- 下载次数:
- 0次
- 提 供 者:
- 吴**
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
一条长廊里依次装有n(1 ≤ n ≤ 65535)盏电灯,从头到尾编号1、2、3、…n-1、n。每盏电灯由一个拉线开关控制。开始,电灯全部关着。
有n个学生从长廊穿过。第一个学生把号码凡是1的倍数的电灯的开关拉一下;接着第二个学生把号码凡是2的倍数的电灯的开关拉一下;接着第三个学生把号码凡是3的倍数的电灯的开关拉一下;如此继续下去,最后第n个学生把号码凡是n的倍数的电灯的开关拉一下。n个学生按此规定走完后,长廊里电灯有几盏亮着。
注:电灯数和学生数一致。-A corridor in turn fitted n (1 ≤ n ≤ 65535) light bulb, from start to finish No. 1,2,3, ... n-1, n. Each light bulb controlled by a pull switch. Start, lights all closed. There are n number of students from across the promenade. The number of students who first light switch in multiples of 1 pull then the number of students who second light switch pull multiple of 2 then a third of the number of students who multiples of three light switches pull case continues, the last n-th number of students who light switch to a multiple of n pull. n After a student has completed this provision, there Jizhan lamp lit corridor. Note: The number of students and the number of lamps in line.
有n个学生从长廊穿过。第一个学生把号码凡是1的倍数的电灯的开关拉一下;接着第二个学生把号码凡是2的倍数的电灯的开关拉一下;接着第三个学生把号码凡是3的倍数的电灯的开关拉一下;如此继续下去,最后第n个学生把号码凡是n的倍数的电灯的开关拉一下。n个学生按此规定走完后,长廊里电灯有几盏亮着。
注:电灯数和学生数一致。-A corridor in turn fitted n (1 ≤ n ≤ 65535) light bulb, from start to finish No. 1,2,3, ... n-1, n. Each light bulb controlled by a pull switch. Start, lights all closed. There are n number of students from across the promenade. The number of students who first light switch in multiples of 1 pull then the number of students who second light switch pull multiple of 2 then a third of the number of students who multiples of three light switches pull case continues, the last n-th number of students who light switch to a multiple of n pull. n After a student has completed this provision, there Jizhan lamp lit corridor. Note: The number of students and the number of lamps in line.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
灭灯\Cpp2.cpp
....\Cpp2.dsp
....\Cpp2.dsw
....\Cpp2.ncb
....\Cpp2.opt
....\Cpp2.plg
....\Debug\Cpp2.exe
....\.....\Cpp2.ilk
....\.....\Cpp2.obj
....\.....\Cpp2.pch
....\.....\Cpp2.pdb
....\.....\vc60.idb
....\.....\vc60.pdb
....\灭灯.dsw
....\灭灯.ncb
....\灭灯.opt
....\Debug
灭灯