the Josephus game implemented by C++