summaryrefslogtreecommitdiff
path: root/other/josephus2.cpp
diff options
context:
space:
mode:
authormzuenni <michi.zuendorf@gmail.com>2022-06-27 17:19:28 +0200
committermzuenni <michi.zuendorf@gmail.com>2022-06-27 17:19:28 +0200
commit5ab8a5088b729a9953b8dff1b2a985dc8fb2098b (patch)
treeed40d6936c0e9eee40ba62751cbf99ecddbaddc2 /other/josephus2.cpp
parentadabbad9c51cf7cd3874bfde8eac1fbcf84fec10 (diff)
updated tcr
Diffstat (limited to 'other/josephus2.cpp')
-rw-r--r--other/josephus2.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/other/josephus2.cpp b/other/josephus2.cpp
index a973609..5086e13 100644
--- a/other/josephus2.cpp
+++ b/other/josephus2.cpp
@@ -1,8 +1,8 @@
int rotateLeft(int n) { // Der letzte Überlebende, 1-basiert.
- for (int i = 31; i >= 0; i--)
+ for (int i = 31; i >= 0; i--) {
if (n & (1 << i)) {
n &= ~(1 << i);
break;
- }
+ }}
n <<= 1; n++; return n;
}