fixed ex5_17.cpp