I believe there's a stream function that peaks at a stream to see if there is anything in the buffer. You could then in an loop check if there is a character in cin, as you print one character at a time to cout. Just be sure that autoflush is on, or that you flush after each character is printed.
EDIT: found it: streambuf::in_avail. You'll need to call cin.rdbuf() to get the buffer.