Use getch() to get the input instead of using cin
, so the input will not be shown (quoting wiki):
int getch(void) Reads a character directly from the console without
buffer, and without echo.
This is really C, not C++, but it might suit you.
Also, there's another link here.