/*** Hanno Tower college, but I didn't understand it at all. The only thing I knew was to solve it with recursion. * Problem description: * There are three rod A, B, C. There are n (n> 1) on the A pole, and the size of the disc has become smaller from bottom to top. * Requires to move all discs to the C -Stranger according to the following rules: * 1. You can only move one disc at a time; * 2. The plate cannot be stacked on the small plate. * Tip: The discs can be temporarily placed in B. The discs that move out of A rod can be moved back to the A rod. * But they must respect the above two rules. * Q: How to move? How many times do you need to move at least? * Solution: * Assuming that there are only two plates, the columns are A, B, C pillar. Then only three steps can move them from A column to C-pillar. * These three steps are A-> B, A-> C, B-> C. * If the number of plates is more than 2, we can think of these plates as two parts: the bottom plate and the n-1 plate above. * These two parts can also move with the above three steps. * In other words, we can call the above steps to move all N plates from the A -pillar to the C -pillar by recursively. * / Package Al; Public Class Hanoi {Public Static Void Main (String [] ARGS) {hanoi Hanoi = New Hanoi (); Hanoi.Move (3, 'A ",' C ');} /* ** @AutHor* @Param N plate number* @param from the starting column* @param Temp intermediate column* @param to target pillar*/ public void move (Int n, char from, char test, char to) {if) {if) {if n == 1) {system.out.println ("Move 1 Plate from" + from + "to" + to);} else {move (n-1, from, to, temp); move (1, from, temp, to); move (n-1, temp, from, to);}}}