as

所属分类:数值算法/人工智能
开发工具:Visual C++
文件大小:2018KB
下载次数:2
上传日期:2010-04-10 22:57:20
上 传 者yl521239
说明:  继续地被总计的一个走廊中有 n 锁柜从 1 对 n。最初,所有的锁柜门被关闭。你制造锁柜的 n 途径,每次出发与锁柜#1.在 ith 途径上, i = 1,2, .。。, n,你拨动每 ith 锁柜的门:如果门被关闭,你打开它,如果它是公开,你关它。举例来说,在第一的个途径每扇门之后是公开;在第二途径上你唯一的拨动偶数锁柜 (#2, #4, ...) 以便在第二途径之后,平坦的门被关闭,而且奇数的被打开;第三次经过你结束锁柜#3(从第一途径打开)的门,打开锁柜#6(关闭从第二途径)的门,等等。在最后途径之后,公开是哪些锁柜门和哪一个被关闭?多少他们是开着的? 你的任务是写一个计画给输出多少门是最后途径后的公开?假定所有的门起先被关闭。 如果 3 平均地进入 F(n)之内分开,印刷 " 是的 " 那个字。
(There are n lockers in a hallway numbered sequentially from 1 to n. Initially, all the locker doors are closed. You make n passes by the lockers, each time starting with locker#1. On the ith pass, i = 1, 2, ..., n, you toggle the door of every ith locker: if the door is closed, you open it, if it is open, you close it. For example, after the first pass every door is open on the second pass you only toggle the even-numbered lockers (#2,#4, ...) so that after the second pass the even doors are closed and the odd ones are opened the third time through you close the door of locker#3 (opened from the first pass), open the door of locker#6 (closed from the second pass), and so on. After the last pass, which locker doors are open and which are closed? How many of them are open? Your task is write a program to output How many doors are open after the last pass? Assumptions all doors are closed at first. Print the word "yes" if 3 divide evenly into F(n). )

文件列表:
as\a.cpp (412, 2010-04-09)
as\a.dsp (3341, 2010-04-09)
as\a.dsw (508, 2010-04-09)
as\a.ncb (41984, 2010-04-09)
as\a.opt (48640, 2010-04-09)
as\a.plg (236, 2010-04-09)
as\as.dsp (4235, 2010-04-01)
as\as.dsw (510, 2010-04-01)
as\as.ncb (33792, 2010-04-01)
as\as.opt (48640, 2010-04-01)
as\as.plg (1355, 2010-04-01)
as\b.cpp (284, 2010-04-09)
as\b.dsp (3341, 2010-04-09)
as\b.dsw (508, 2010-04-09)
as\b.ncb (41984, 2010-04-09)
as\b.opt (48640, 2010-04-09)
as\b.plg (1183, 2010-04-09)
as\c.cpp (263, 2010-04-09)
as\c.dsp (3341, 2010-04-10)
as\c.dsw (508, 2010-04-10)
as\c.ncb (41984, 2010-04-10)
as\c.opt (48640, 2010-04-10)
as\c.plg (236, 2010-04-10)
as\Debug\a.exe (536627, 2010-04-09)
as\Debug\a.ilk (775588, 2010-04-09)
as\Debug\a.obj (179574, 2010-04-09)
as\Debug\a.pch (1997324, 2010-04-01)
as\Debug\a.pdb (1082368, 2010-04-09)
as\Debug\b.pch (1997324, 2010-04-09)
as\Debug\c.exe (536627, 2010-04-09)
as\Debug\c.ilk (775808, 2010-04-09)
as\Debug\c.obj (189508, 2010-04-09)
as\Debug\c.pch (1997324, 2010-04-09)
as\Debug\c.pdb (1082368, 2010-04-09)
as\Debug\vc60.idb (91136, 2010-04-10)
as\Debug\vc60.pdb (118784, 2010-04-09)
as\Debug (0, 2010-04-09)
as (0, 2010-04-09)

近期下载者

相关文件


收藏者