Non-recursive solution for writing Hanno Tower in C++