C++ solutions for the BOOK