Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Josephus-problem/Quite-BASIC/josephus-problem.basic
Normal file
11
Task/Josephus-problem/Quite-BASIC/josephus-problem.basic
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
10 LET N = 41
|
||||
20 LET K = 3
|
||||
30 LET M = 0
|
||||
40 GOSUB 100
|
||||
50 PRINT "N = " ; N; " K = "; K; " FINAL SURVIVOR ="; S
|
||||
60 END
|
||||
100 LET S = M
|
||||
110 FOR A = M+1 TO N
|
||||
120 LET S = INT(A * ((S+K) / A - INT((S+K) / A)) + 0.5)
|
||||
130 NEXT A
|
||||
140 RETURN
|
||||
Loading…
Add table
Add a link
Reference in a new issue