C++ code evaluation solutions