Add solution to problem

Done! Added the output.txt file as well.
awesome, way to use the stream interface.