void SetColor(int k) { HANDLE hConsoleColor; hConsoleColor = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(hConsoleColor, k); } //Exit char ch; while (true) { if (_kbhit()) { ch = _getch(); if (int(ch) == 27) break; } }