C++ pattern exercise