假設我們以在螢幕上印出move from a to b 表示將a柱最上面的碟子移到b柱上,則 n=3時應印出下列輸出
move from 1 to 2
move from 1 to 3
move from 2 to 3
move from 1 to 2
move from 3 to 1
move from 3 to 2
move from 1 to 2

主程式的範例如下
/**
 * Your description about the program
 */
#include <stdio.h>
void hanoi(int n, int from, int to, int temp) {
    // fill in your code
}
int main() {
    int n=0;
    while (scanf("%d",&n)!=EOF && n>0) {
        hanoi(n,1,2,3);
    }
}