diff options
Diffstat (limited to 'other/josephusK.cpp')
| -rw-r--r-- | other/josephusK.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/other/josephusK.cpp b/other/josephusK.cpp index 522b584..8d4df4d 100644 --- a/other/josephusK.cpp +++ b/other/josephusK.cpp @@ -1,4 +1,5 @@ -int josephus(int n, int k) { // Der letzte Überlebende, 0-basiert. +// Der letzte Überlebende, 0-basiert. +int josephus(int n, int k) { if (n == 1) return 0; return (josephus(n - 1, k) + k) % n; }
\ No newline at end of file |
