version 1.0 prob1.cpp