文件名称:task
- 所属分类:
- 数据结构常用算法
- 资源属性:
- [Windows] [Visual.Net] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 685kb
- 下载次数:
- 1次
- 提 供 者:
- 苹*
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
加里森的任务
有n个加里森敢死队的队员要炸掉敌人的一个军火库,谁都不想去,队长加里森决定用轮回数数的办法来决定哪个战士去执行任务。如果前一个战士没完成任务,则要再派一个战士上去。现给每个战士编一个号,大家围坐成一圈,随便从某一个战士开始计数,当数到5时,对应的战士就去执行任务,且此战士不再参加下一轮计数。如果此战士没完成任务,再从下一个战士开始数数,被数到第5时,此战士接着去执行任务。以此类推,直到任务完成为止。
加里森本人是不愿意去的,假设加里森为1号,请你设计一程序为加里森支招,求出从第几号战士开始计数才能让加里森最后一个留下来而不去执行任务。
要求自拟1个实验实例验证程序正确性(即:n自拟)。
-Garrison s task
A n garrison of death squads players to blow up the enemy s a Arsenal, who all don t want to go, captain garrison decided to use to cycle count to decide which soldiers to perform the task. If a soldier before didn t finish the task, want to be a warrior and send up. Now give each soldier make up a number, you sit in a circle, literally from a soldier began to count, when several to 5, the corresponding warrior is to perform the task, and the warrior will no longer take part in the next round of counting. If the soldiers didn t finish the task, and from a soldier began to count down, number to the fifth, the soldiers then to perform the task. And so on, until task completion date.
Garrison himself does not want to go to is, provided garrison for 1, please design a program for the garrison court, find out what number from soldiers start counting to make garrison last to stay and not to perform the task.
Since one experiment to request an example to verify the correctn
有n个加里森敢死队的队员要炸掉敌人的一个军火库,谁都不想去,队长加里森决定用轮回数数的办法来决定哪个战士去执行任务。如果前一个战士没完成任务,则要再派一个战士上去。现给每个战士编一个号,大家围坐成一圈,随便从某一个战士开始计数,当数到5时,对应的战士就去执行任务,且此战士不再参加下一轮计数。如果此战士没完成任务,再从下一个战士开始数数,被数到第5时,此战士接着去执行任务。以此类推,直到任务完成为止。
加里森本人是不愿意去的,假设加里森为1号,请你设计一程序为加里森支招,求出从第几号战士开始计数才能让加里森最后一个留下来而不去执行任务。
要求自拟1个实验实例验证程序正确性(即:n自拟)。
-Garrison s task
A n garrison of death squads players to blow up the enemy s a Arsenal, who all don t want to go, captain garrison decided to use to cycle count to decide which soldiers to perform the task. If a soldier before didn t finish the task, want to be a warrior and send up. Now give each soldier make up a number, you sit in a circle, literally from a soldier began to count, when several to 5, the corresponding warrior is to perform the task, and the warrior will no longer take part in the next round of counting. If the soldiers didn t finish the task, and from a soldier began to count down, number to the fifth, the soldiers then to perform the task. And so on, until task completion date.
Garrison himself does not want to go to is, provided garrison for 1, please design a program for the garrison court, find out what number from soldiers start counting to make garrison last to stay and not to perform the task.
Since one experiment to request an example to verify the correctn
(系统自动生成,下载前可以参看下载内容)
下载文件列表
静态实现\Debug\改进.exe
........\.....\改进.ilk
........\.....\改进.pdb
........\ipch\改进-43de60df\改进-873d65c0.ipch
........\静态\Debug\CL.read.1.tlog
........\....\.....\CL.write.1.tlog
........\....\.....\link-cvtres.read.1.tlog
........\....\.....\link-cvtres.write.1.tlog
........\....\.....\link.3036-cvtres.read.1.tlog
........\....\.....\link.3036-cvtres.write.1.tlog
........\....\.....\link.3036.read.1.tlog
........\....\.....\link.3036.write.1.tlog
........\....\.....\link.read.1.tlog
........\....\.....\link.write.1.tlog
........\....\.....\mt.read.1.tlog
........\....\.....\mt.write.1.tlog
........\....\.....\rc.read.1.tlog
........\....\.....\rc.write.1.tlog
........\....\.....\vc100.idb
........\....\.....\vc100.pdb
........\....\.....\改进.exe.embed.manifest
........\....\.....\改进.exe.embed.manifest.res
........\....\.....\改进.exe.intermediate.manifest
........\....\.....\改进.lastbuildstate
........\....\.....\改进.log
........\....\.....\改进_manifest.rc
........\....\.....\改进之.obj
........\....\改进.vcxproj
........\....\改进.vcxproj.filters
........\....\改进.vcxproj.user
........\....\改进之.cpp
........\静态.sdf
........\静态.sln
........\静态.suo
........\ipch\改进-43de60df
........\静态\Debug
........\Debug
........\ipch
........\静态
静态实现
........\.....\改进.ilk
........\.....\改进.pdb
........\ipch\改进-43de60df\改进-873d65c0.ipch
........\静态\Debug\CL.read.1.tlog
........\....\.....\CL.write.1.tlog
........\....\.....\link-cvtres.read.1.tlog
........\....\.....\link-cvtres.write.1.tlog
........\....\.....\link.3036-cvtres.read.1.tlog
........\....\.....\link.3036-cvtres.write.1.tlog
........\....\.....\link.3036.read.1.tlog
........\....\.....\link.3036.write.1.tlog
........\....\.....\link.read.1.tlog
........\....\.....\link.write.1.tlog
........\....\.....\mt.read.1.tlog
........\....\.....\mt.write.1.tlog
........\....\.....\rc.read.1.tlog
........\....\.....\rc.write.1.tlog
........\....\.....\vc100.idb
........\....\.....\vc100.pdb
........\....\.....\改进.exe.embed.manifest
........\....\.....\改进.exe.embed.manifest.res
........\....\.....\改进.exe.intermediate.manifest
........\....\.....\改进.lastbuildstate
........\....\.....\改进.log
........\....\.....\改进_manifest.rc
........\....\.....\改进之.obj
........\....\改进.vcxproj
........\....\改进.vcxproj.filters
........\....\改进.vcxproj.user
........\....\改进之.cpp
........\静态.sdf
........\静态.sln
........\静态.suo
........\ipch\改进-43de60df
........\静态\Debug
........\Debug
........\ipch
........\静态
静态实现