Create exercise3.31.cpp