河內塔 - 維基百科,自由的百科全書

河內塔 - 維基百科,自由的百科全書

瀏覽:467
日期:2024-05-09
河內塔 是根據一個傳說形成的一個問題: 有三根杆子A,B,C。A桿上有N個(N>1)穿孔圓盤 ... 在 C語言中: int conf [HEIGHT]; /* Element conf[d] gives the current position of disk d. */ void move (int d, int t) {/* move disk d to peg t */ conf [d] = t;} void hanoi (int h, ......看更多