首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > Matlab > 山上有m只猴子要选大王,选举办法如下:所有猴子从1到m进行编号并围坐一圈,从第一号开始按顺序1,2,...n继续报数,凡是报n号的猴子都退出到圈外,照此循环报数...

山上有m只猴子要选大王,选举办法如下:所有猴子从1到m进行编号并围坐一圈,从第一号开始按顺序1,2,...n继续报数,凡是报n号的猴子都退出到圈外,照此循环报数...

  • 资源大小:516.00 B
  • 上传时间:2021-06-29
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: Matlab

资 源 简 介

山上有m只猴子要选大王,选举办法如下:所有猴子从1到m进行编号并围坐一圈,从第一号开始按顺序1,2,...n继续报数,凡是报n号的猴子都退出到圈外,照此循环报数,直到圈内只剩下一只猴子时,这只猴子就是大王.输出大王的编号。 -Mountains have m of the monkeys to elect king, method of election are as follows: All monkeys are numbered from 1 to m, and sitting around a circle, to begin from the first order 1,2, ... n continue to report the number of those who reported that n No. The monkeys are out to outsiders the basis of this report the number of cycles until the circle only one monkey, the monkey is king. Output King number.

文 件 列 表

Monkey.txt
VIP VIP
0.184939s