Update problem5.cpp