请问这题怎么做 感觉无从下手!
这道题这么做?麻烦诸位高手!越想越只要不到头绪!不能用指针 不可以用链表!!
3、报数出局问题:17个人围圈,编号1-17。从1开始顺序报数,数到3的倍数离开。显示 每次出局信息。输出界面如下:
The original order is:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
3 is out! the new order is : 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17
6 is out! the new order is : 1 2 4 5 7 8 9 10 11 12 13 14 15 16 17
…
1 is out! the new order is: 2 4 5 7 8 10 11 13 14 16 17 (注意,是围圈的)
5 is out! the new order is: 2 4 7 8 10 11 13 14 16 17
…
11 is out! The game is over!