#include #define N 16 using namespace std; /* * 1 _ * 2 __ * 3 ___ * ____ _____ _____ * 1 2 3 */ int i=0; void move(int n, int from, int to, int by) { i++; if (n > 1) { move(n-1, from, by, to); } cout << "Bewege Scheibe " << n << " von Pos. \'" << from << "\' nach Pos. \ \'" << to << "\'" << endl; if (n > 1) { move(n-1, by, to, from); } } int main(void) { move(N, 1, 3, 2); cout << "number of moves: " << i << endl; return 0; }