Updated main.cpp to read from standard input.