A more C++ 11 version of problem 03