C++ primer exercises code created by lvchong