1 #include<iostream> 2 using namespace std; 3 AllocConsole(); 4 freopen("CONIN$", "r+t", stdin); // 重定向 STDIN 5 freopen("CONOUT$", "w+t", stdout); // 重定向STDOUT