Update lab3.cpp

part 3