My exercised code of C++