神秘代码
2026-08-11 16:32:57
发布于:北京
放到DEV-C++运行。代码具有神秘色彩,胆小不适、光敏癫痫者请勿运行!若感到任何不适请立刻关闭窗口
#include <bits/stdc++.h>
#include <windows.h>
using namespace std;
char colorList[] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
void gotoxy(int x, int y) {
COORD pos{SHORT(x), SHORT(y)};
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
}
int main() {
srand((unsigned)time(nullptr));
CONSOLE_CURSOR_INFO curInfo{1, FALSE};
SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &curInfo);
while (true) {
char bg = colorList[rand() % 16];
char fg = colorList[rand() % 16];
if (bg == fg) continue;
string cmd = "color ";
cmd += bg;
cmd += fg;
system(cmd.c_str());
for (int t = 0; t < 120; t++) {
int x = rand() % 78;
int y = rand() % 24;
gotoxy(x, y);
char ch = 33 + (rand() % 94);
cout << ch;
}
Sleep(2);
}
return 0;
}
这里空空如也



















有帮助,赞一个