void ycgb()//隐藏光标
{
CONSOLE_CURSOR_INFO cursor;
cursor.bVisible = FALSE;
cursor.dwSize = sizeof(cursor);
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorInfo(handle, &cursor);
return;
}
void ydgb(long long h, long long l)//移动光标
{
COORD pos = { l - 1,h - 1 };
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hOut, pos);
return;
}
void gs(long long h, long long l, string z)//格式
{
for (long long i = 1; i <= h; i++)
cout << "\n";
for (long long i = 1; i <= l; i++)
cout << " ";
cout << z;
return;
}
void gckdx(short h, short l)
{
string n = "mode con cols=", t = "";
while (l > 0)
{
t = t + char(l % 10 + '0');
l /= 10;
}
for (short i = t.size() - 1; i >= 0; i--)
{
n = n + t[i];
}
n = n + " lines=", t = "";
while (h > 0)
{
t = t + char(h % 10 + '0');
h /= 10;
}
for (short i = t.size() - 1; i >= 0; i--)
{
n = n + t[i];
}
system(&n[0]);
return;
}
void gckm(string n)
{
string t = "title ";
t += n;
system(&t[0]);
return;
}
抄写的C++常用函数
于 2022-04-08 18:16:47 首次发布