Use endl instead of "\n".