June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
5
Task/Josephus-problem/BASIC/josephus-problem-2.basic
Normal file
5
Task/Josephus-problem/BASIC/josephus-problem-2.basic
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
10 DEF FN MOD(X) = X - INT (X / A) * A
|
||||
20 LM = 0: INPUT "GIVE N AND K (N,K): ";N,K
|
||||
30 IF N < 1 or K < 1 THEN GOTO 20
|
||||
40 FOR A = 1 TO N: LM = FN MOD(LM + K): NEXT A
|
||||
50 PRINT "N = ";N;", K = ";K;", SURVIVOR: ";LM
|
||||
Loading…
Add table
Add a link
Reference in a new issue