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

您现在的位置是:虫虫源码 > 其他 > 约瑟夫环:编号为1,2,3,…,n的n个人按顺时针方向围坐一圈,每人持有一个密码(正整数)。一开始任选一个正整数作为报数的上限值m,从第一个人开始按顺时针方向自...

约瑟夫环:编号为1,2,3,…,n的n个人按顺时针方向围坐一圈,每人持有一个密码(正整数)。一开始任选一个正整数作为报数的上限值m,从第一个人开始按顺时针方向自...

资 源 简 介

约瑟夫环:编号为1,2,3,…,n的n个人按顺时针方向围坐一圈,每人持有一个密码(正整数)。一开始任选一个正整数作为报数的上限值m,从第一个人开始按顺时针方向自1开始顺序报数,报到m时停止。报m的人出列,将他的密码作为新的m值,从他在顺时针方向上的下一人开始重新从1报数,如此下去,直到所有人全部出列为止。编程打印出列顺序。-Josephus : No. 1, 2, 3, ..., n n clockwise direction by individuals sitting around a circle, each holding a password (positive integers). An optional started as a positive integer reported limits on the number of m, from the first individuals to embark on the clockwise direction since the beginning of a sequence number off, the report m stop. M reported out of the list of his password as a new value m, from a clockwise direction in the next one started from a newspaper a few, like that, until the total of all listed so far. Programming print out the order.

文 件 列 表

T3.cpp
VIP VIP
  • 大智若愚 5小时前 成为了本站会员

  • Mason 8小时前 成为了本站会员

  • 8小时前 成为了本站会员

  • Half_Punch 1天前 成为了本站会员

  • liqing71718 1天前 成为了本站会员

  • 伟国 1天前 成为了本站会员

  • songy 1天前 成为了本站会员

  • 纯色幽默 1天前 成为了本站会员

  • odd? 1天前 成为了本站会员

  • 52JOY... 1天前 成为了本站会员

0.175061s