C++ solution to the problem of the Tower of Hanoi