getline之前加一句cout.flush();
不带endl或'\n'结束的cout,不一定立即把输出缓冲区中内容实际输出到屏幕显示,调用cout.flush()强制将输出缓冲区中内容实际输出到屏幕显示