ques18.cpp