MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / main

Method main

Java/Recursion/joshephus.java:10–16  ·  view source on GitHub ↗
(String args[])

Source from the content-addressed store, hash-verified

8 return (Jos(n - 1,k) + k-1) % n + 1;
9 }
10 public static void main(String args[])
11 {
12 Scanner I = new Scanner(System.in);
13 int n = I.nextInt(), k = I.nextInt();
14 System.out.println(Jos(n,k));
15 I.close();
16 }
17}
18/*when starting pos is 0
19import java.util.*;

Callers

nothing calls this directly

Calls 1

JosMethod · 0.95

Tested by

no test coverage detected