-->
当前位置:首页 > 题库

PROGRAMMING:Analog counting game (Joseph Ring problem)

Luz5年前 (2021-05-10)题库399
There are n people in a circle, numbered sequentially from 1, counted from 1 to K from the first person, and those who reported to K quit the circle; Then the circle narrows down and continues to play from the next person, asking what number is left (only one person left). Function implementation is required.
###Input format:
Initial N and K are freely specified.
###Output format:
Finally, the original serial number of the person is left and displayed in the form of a list.
###Input example:
Here is a set of inputs. For example:
```in
forty-five
four
```
###Output example:
The corresponding output is given here. For example:
```out
[27]
```







answer:If there is no answer, please comment