add problem_005.cpp
implement problem 5 solution