Update ex3.cpp