//函数封装

bool GetConsoleWH(int& _w,int& _h) {
	// 获取控制台句柄
	HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
	if (INVALID_HANDLE_VALUE != hConsole) {
		// 获取控制台信息
		CONSOLE_SCREEN_BUFFER_INFO csbi;
		if (GetConsoleScreenBufferInfo(hConsole, &csbi)) {
			// 宽度和高度
			_w = csbi.srWindow.Right - csbi.srWindow.Left + 1; // 注意加1
			_h = csbi.srWindow.Bottom - csbi.srWindow.Top + 1; // 注意加1
			//printf("%d %d\n", width, height);
			return true;
		}
	}
	return false;
}