文件名称:c
介绍说明--下载内容来自于网络,使用问题请自行百度
约瑟夫问题的实现:设有n个人围坐在圆桌周围,现从某个位置m(1≤m≤n)上的人开始报数,报数到k的人就站出来。下一个人,即原来的第k+1个位置上的人,又从1开始报数,再报数到k的人站出来。依此重复下去,直到全部的人都站出来为止。试设计一个程序求出出列序列。-Joseph realized the problem: There are n people sitting around the round table, is from a position of m (1 ≤ m ≤ n) reported on the number of people began to be reported to the k number of people to come forward. The next person, that is, the original positions on the first k+1 people, and from the number reported at 1, then the number reported to the k to stand up. So repeat this until all the others can stand up. Try to design a program derived from the column sequence.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
1.C
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.