exercise for c++ primer