Create main.cpp

Added all the code.