Exercise about learning c++ with help of c++ primer 5th edition