Implemented "cooked" I/O with getchar() and putchar()