A great C++ exercise