123456789101112131415161718192021222324252627282930
#include <iostream> #include <windows.h> #include <conio.h> #include <cstdlib> #include <string> using namespace std; int main() { bool n=1; while (true) { if (GetAsyncKeyState(VK_UP)) { n + 1; cout << n << endl; continue; } else if (GetAsyncKeyState(VK_DOWN)) { n - 1; cout << n << endl; continue; } } }