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

PROGRAMMING:Monkey chooses King

Luz5年前 (2021-05-10)题库450
A group of monkeys want to choose a new monkey king. The new monkey king's selection method is: let N candidate monkeys form a circle, from a certain position, the sequence number is 1 ~ n. Start counting from No. 1, and report from 1 to 3 in each round. All monkeys who report to 3 will quit the circle, and then start counting from the next monkey next to them. In this way, the remaining monkey is chosen as the monkey king. Which monkey was elected the monkey king?
###Input format:
Enter a positive integer n ($$$Le $$1000) on a line.
###Output format:
Output the number of the monkey king in one line.
###Input example:
```in
eleven
```
###Output example:
```out
seven
```






answer:If there is no answer, please comment