文件名称:The-number-of-lit-lamps
介绍说明--下载内容均来自于网络,请自行研究使用
写的一个程序关于,一条长廊里依次装有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