Update main.c

Changed from file output to stream output.