Update ex05.cpp

Adjust to better match the exercise.