Windows 开启win32 控制台
{
AllocConsole();
FILE *Journal = NULL;
freopen_s(&Journal, "CONOUT$", "a+", stdout);
//或者
#ifdef WIN32
_tsetlocale(LC_ALL, _T(" "));
::AllocConsole();
::freopen("CONIN$", "r", stdin);
::freopen("CONOUT$", "w", stdout);
::freopen("CONOUT$", "w", stderr);
#endif // WIN32
}