Create hw3.cpp

C++ code for home work #3