登录
首页 » Visual C++ » 约瑟夫

约瑟夫

于 2005-01-06 发布 文件大小:1KB
0 38
下载积分: 1 下载次数: 13

代码说明:

  约瑟夫问题的一种描述是:编号为1,2,…,n的n个人按顺时针方向围坐一圈,没人持有一个密码。一开始人选一个正整数作为报数上限值m,从第一个人开始按顺时针自1开始报数,报到m是停止报数。报m的人出列,将他的密码作为新的m值,从他在顺时针方向上的下一个人开始重新从1报数,如此下去,直至所有人全部出列为止。(a description of the problem is : No. 1, 2, ..., n n clockwise direction by individuals sitting around a circle, no one holding a password. One person started as a positive integer limits on the number of reported m, from the first individuals to embark on the clockwise from a few reportedly started, the report m is reportedly stopped a few. M reported out of the list of his password as a new value m, from a clockwise direction in the next re-started from a newspaper a few, like that, until the total of all listed so far.)

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 696518资源总数
  • 104224会员总数
  • 54今日下载