文件名称:monkeyking
介绍说明--下载内容均来自于网络,请自行研究使用
猴子选大王。n只猴子围成一圈,从1到m报数,报m的猴子出局。余下的猴子从第m+1只开始继续从1到m报数,报m的猴子出局。第n只猴子报数后,第1只猴子接着报数(因为围成了圈)。待整个圈只剩下一只猴子时,该猴子即为大王。n和m由用户输入,请输出当选大王的猴子的编号。-King monkeys election. n monkeys circle, from 1 to m reported that the number of reported m the monkey out of the game. The remaining monkeys only from m+1 continue from 1 to m reported that the number of reported m the monkey out of the game. The monkeys n-count off, a monkey then reported the number (because huddled in a circle). Until the entire circle is only a monkey, the monkey is the king. n and m are input by the user, output the number of the elected king of the monkeys.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
猴子选大王.cpp