文件名称:The-number-of-lit-lamps
-
所属分类:
- 标签属性:
- 上传时间:2015-12-22
-
文件大小:6.6kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
写的一个程序关于,一条长廊里依次装有n(1 ≤ n ≤ 65535)盏电灯,从头到尾编号1、2、3、…n-1、n。每盏电灯由一个拉线开关控制。开始,电灯全部关着。
有n个学生从长廊穿过。第一个学生把号码凡是1的倍数的电灯的开关拉一下;接着第二个学生把号码凡是2的倍数的电灯的开关拉一下;接着第三个学生把号码凡是3的倍数的电灯的开关拉一下;如此继续下去,最后第n个学生把号码凡是n的倍数的电灯的开关拉一下。n个学生按此规定走完后,长廊里电灯有几盏亮着。注:电灯数和学生数一致。
-Followed by a corridor containing n (1 ≤ n ≤ 65535) electric lamp, start to finish number 1,2,3, ... n-1, n. Each electric lamp controlled by a pull switch. Start, lights all closed.
There are n number of students across the promenade. The first students to number every light switch in multiples of 1 pull then the second student numbers every light switch to a multiple of 2 pull then a third of the number of students who multiples of three lamp switch pull so continue, and finally the first n the number of students who lamp switch multiple of n of pull. n After a student has completed this provision, there is Jizhan lamp lit corridor. Note: The lamp number and the number of students the same.
有n个学生从长廊穿过。第一个学生把号码凡是1的倍数的电灯的开关拉一下;接着第二个学生把号码凡是2的倍数的电灯的开关拉一下;接着第三个学生把号码凡是3的倍数的电灯的开关拉一下;如此继续下去,最后第n个学生把号码凡是n的倍数的电灯的开关拉一下。n个学生按此规定走完后,长廊里电灯有几盏亮着。注:电灯数和学生数一致。
-Followed by a corridor containing n (1 ≤ n ≤ 65535) electric lamp, start to finish number 1,2,3, ... n-1, n. Each electric lamp controlled by a pull switch. Start, lights all closed.
There are n number of students across the promenade. The first students to number every light switch in multiples of 1 pull then the second student numbers every light switch to a multiple of 2 pull then a third of the number of students who multiples of three lamp switch pull so continue, and finally the first n the number of students who lamp switch multiple of n of pull. n After a student has completed this provision, there is Jizhan lamp lit corridor. Note: The lamp number and the number of students the same.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
The number of lit lamps.doc
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.