compilation: g++ -o lab1 lab1.cpp
description: I use a do,while funtion to examine if the terminal condition is reached.As for deciding whether n is odd or even, I devide n by 2 and see if the remainder is 0.