文件名称:HanoiTowerSequence
介绍说明--下载内容均来自于网络,请自行研究使用
题目大意:
经典的汉诺塔
n个盘编号,从小到大 1..n
问:移动的序列中第k步移的是哪个盘
-Input
The first line of the input file is T, the number of test cases.
Each test case contains one integer p (1<=p<10^100).
Output
Output the pth element of the sequence in a single line. See the sample for the output format.
Print a blank line between the test cases.
Sample Input
Copy to clipboard
4
1
4
100
100000000000000
Sample Output
Case 1: 1
Case 2: 3
Case 3: 3
Case 4: 15
经典的汉诺塔
n个盘编号,从小到大 1..n
问:移动的序列中第k步移的是哪个盘
-Input
The first line of the input file is T, the number of test cases.
Each test case contains one integer p (1<=p<10^100).
Output
Output the pth element of the sequence in a single line. See the sample for the output format.
Print a blank line between the test cases.
Sample Input
Copy to clipboard
4
1
4
100
100000000000000
Sample Output
Case 1: 1
Case 2: 3
Case 3: 3
Case 4: 15
(系统自动生成,下载前可以参看下载内容)
下载文件列表
1028 - Hanoi Tower Sequence.cpp