Updated 9.cpp