Update main.cpp

Updated the code to represent that it also works with three char(acters:p)