c++ matrix home assignment