reuse cin for the bug that getchar() will cause