文件名称: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
1999-2046 搜珍网 All Rights Reserved.
本站作为网络服务提供者,仅为网络服务对象提供信息存储空间,仅对用户上载内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。
