Exercice in C++ primer.