September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
11
Task/Josephus-problem/Ring/josephus-problem.ring
Normal file
11
Task/Josephus-problem/Ring/josephus-problem.ring
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
n = 41
|
||||
k=3
|
||||
see "n =" + n + " k = " + k + " final survivor = " + josephus(n, k, 0) + nl
|
||||
|
||||
func josephus (n, k, m)
|
||||
lm = m
|
||||
for a = m+1 to n
|
||||
lm = (lm+k) % a
|
||||
next
|
||||
josephus = lm
|
||||
return josephus
|
||||
Loading…
Add table
Add a link
Reference in a new issue