文件名称:gansidui
介绍说明--下载内容来自于网络,使用问题请自行百度
有M 个敢死队员要炸掉敌人的一碉堡,谁都不想去,排长决定用轮 回数数的办法来决定哪个战士去执行任务。如果前一个战士没完成任务,则要再派一个战士上去。现给每个战士编一个号,大家围坐成一圈,随便从某一个战士开始计数,当数到5 时,对应的战士就去执行任务,且此战士不再参加下一轮计数。如果此战士没完成任 务,再从下一个战士开始数数,被数到第 5 时,此战士接着去执行 任务。以此类推,直到任务完成为止。排长是不愿意去的,假设排长为 1 号,请你设计一程序,求出从第几号战士开始计数才能让排长最后一个留下来而不去执行任务。-M squads to blow up the enemy bunkers, no one wanted to go, the platoon leader decided to use the cycle count of the way to decide which fighters to perform the task. , Will have to dispatch a soldier to go before a soldier did not complete the task. Now compiled one for each soldier, we were sitting in a circle and start counting from a soldier casually, when the count to 5, the soldiers went to the mission, this soldier is no longer participate in the next round of counting. If this soldier did not complete the task, and began to count again from the next soldier, to be the number of Section 5, this warrior went on to perform the task. And so on, until the task is completed. The platoon leader is unwilling to assume on the 1st platoon leader, you design a program, find start counting from the first of several soldiers in order to allow the platoon leader to the last one to stay rather than to perform the task.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
gansidui/敢死队问题.doc
gansidui/敢死队问题(无注释).c
gansidui/敢死队问题(无注释).o
gansidui
gansidui/敢死队问题(无注释).c
gansidui/敢死队问题(无注释).o
gansidui
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.