跳到正文

休闲·娱乐

数字炸弹,还没开始写

SilverChariot_R约 2 分钟
原文
文章信息与版本

文章信息

发布
2026年9月6日
收录
2026年9月6日
更新
2026年11月16日
篇幅
约 2 分钟
获赞
1

版本

  1. v1当前
C++
#include <bits/stdc++.h> 
#include <windows.h>

using namespace std; 

void HideCursor () {
    HANDLE hOutput = GetStdHandle(STD_OUTPUT_HANDLE);
    CONSOLE_CURSOR_INFO cursorInfo;
    
    GetConsoleCursorInfo(hOutput, &cursorInfo);
    
    cursorInfo.bVisible = FALSE;
    
    SetConsoleCursorInfo(hOutput, &cursorInfo);
}


bool key_pressed (int vk) {
    return (GetAsyncKeyState (vk) & 1) != 0;
}

void gotoxy(int x, int y) {
    COORD coord;
    coord.X = x;
    coord.Y = y;
    SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
}

signed main (void) {
	HideCursor ();
	bool now_choose = false;
	while (! key_pressed ('Z')) {
		cout << "请选择模式(无尽模式或单轮)" << endl;
		if (now_choose)
			cout << "[ ] 单轮模式    [v] 无尽模式" << endl;
		else 
			cout << "[v] 单轮模式    [ ] 无尽模式" << endl;
		if (key_pressed (VK_RIGHT) || key_pressed (VK_LEFT)) {
			now_choose = !now_choose;
		}
		gotoxy (0, 0);
		// Sleep (50);
	}
	
	cout << "请按任意键继续...\n";
	
	
	return 0;
}
原文