Update main.cpp

Add if else statement