Python3下约瑟夫环的不同实现方式
摘要:基于python的约瑟夫环 思路一:递归 # 约瑟夫环:递归 def KillYuesefu(n,m): if(n == 1): return 0 return (KillYuesefu(n - 1, m) + m ) % n def main(): for num in range(1,11):
阅读全文
posted @ 2022-01-31 17:22
posted @ 2022-01-31 17:22
posted @ 2016-05-11 09:16
posted @ 2016-05-11 09:13
posted @ 2016-05-09 14:19