跳到正文

休闲·娱乐

【整活】额...这病毒

tomyyf约 11 分钟
原文
文章信息与版本

文章信息

发布
2026年1月1日
收录
2026年1月3日
更新
2026年11月17日
篇幅
约 11 分钟

版本

  1. v2当前
  2. v1

本蒟蒻第一次发专栏,希望大家多多支持 温馨提示:最好全屏游玩,如果鼠标乱飞可以按Ctrl+c退出(这是c++哦),如果鼠标被定住…(看好每一句话) 虽然不长但挺好玩

祝大家新年快乐

C++
#include <bits/stdc++.h>
#include<windows.h>
#include<ctime>
#include <cstdlib>
#include <thread>
#include <atomic>
#include <conio.h>
using namespace std;
#define inr long long
#define fi first
#define sr second
#define pb push_back
#define si size
class MouseController {
private:
    std::atomic<bool> isLocked{false};
    std::atomic<bool> isRunning{true};
    std::thread lockThread;

    POINT originalPos;

public:
    ~MouseController() {
        unlockMouse();
    }

    void lockMouse() {
        if (isLocked) {
            return;
        }

        isLocked = true;

        GetCursorPos(&originalPos);

        lockThread = std::thread([this]() {
            while (isLocked && isRunning) {
                RECT tinyRect = {originalPos.x, originalPos.y,
                                 originalPos.x + 1, originalPos.y + 1};
                ClipCursor(&tinyRect);

                POINT currentPos;
                GetCursorPos(&currentPos);
                if (currentPos.x != originalPos.x || currentPos.y != originalPos.y) {
                    SetCursorPos(originalPos.x, originalPos.y);
                }

                std::this_thread::sleep_for(std::chrono::milliseconds(10));
            }
        });

    }

    void unlockMouse() {
        if (!isLocked) {
            return;
        }

        isLocked = false;
        ClipCursor(nullptr);

        if (lockThread.joinable()) {
            lockThread.join();
        }

    }
    bool isMouseLocked() const {
        return isLocked;
    }
    void stop() {
        isRunning = false;
        unlockMouse();
    }
};

void boom(string s){
	int x=GetSystemMetrics(SM_CXSCREEN);
	int y=GetSystemMetrics(SM_CYSCREEN);
	while(1){
		SetCursorPos(rand()%x,rand()%y);
		cout<<s;
	}
}
int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	time(0);
	cout<<"您的电脑有一些病毒"<<endl;
	Sleep(3000);
	cout<<"您是否要检修"<<endl;
	cout<<"1,要  2,不要"<<endl;
	int x;
	cin>>x;
	if(x!=1){
		system("cls");
		cout<<"那么抱歉,我们无法确保您的电脑安全"<<endl;
		Sleep(2000);
		system("color F1");
		Sleep(1000);
		boom("熊猫烧香");
	}
	system("cls");
	cout<<"您要使用哪一款消毒软件?"<<endl;
	cout<<"1,金山 2,360 3,威猛先生"<<endl;
	cin>>x;
	system("cls");
	if(x==3){
		cout<<"您的电脑成功变成一间价值几千的厕所,十分廉价"<<endl;
		boom("");
	}
	if(x==2){
		cout<<"666,你尽然还用360?????????????????"<<endl;
		boom("");
	}
	cout<<"ok,作为您的电脑安全管家,现在开始检查电脑"<<endl;
	Sleep(2000);
	system("cls");
	for(int i=0;i<50;i++){
		cout<<i<<'%'<<endl;
		Sleep(150);
		system("cls");
	}
	cout<<50<<'%'<<endl;
	Sleep(3000);
	cout<<"好像卡住了,是否重启"<<endl;
	cout<<"1,重启 2,等着"<<endl;
	cin>>x;
	if(x==1){
		system("cls");
		cout<<"重启失败"<<endl;
		Sleep(2000);
		system("color F1");
		Sleep(1000);
		boom("熊猫烧香");
	}
	Sleep(1000);
	for(int i=51;i<100;i++){
		system("cls");
		Sleep(50);
		cout<<i<<'%'<<endl;
	}
	system("cls");
	cout<<"100%"<<endl;
	Sleep(4000);
	system("cls");
	int n=1;
	cout<<"检测完毕,您的电脑被"<<n<<"个病毒入侵"<<endl;
	Sleep(3000);
	cout<<"我的力量还不够"<<endl;
	cout<<"要你帮助"<<endl;
	Sleep(2000);
	cout<<"我需要你帮我把屏幕上的数字打出来,我会把你的鼠标锁住,因为病毒会从鼠标这个点侵入电脑"<<endl;
	Sleep(3000);
	int a[30]={5,4,1,8,8,1,4,5,2,4,1,2,3,4,6,2,2,4,5,1,3,4,5,0,9,2,0,0,5,6};
	for(int i=0;i<30;i++){
		MouseController mouseCtrl;
		cout<<a[i]<<endl;
		while(1){
			mouseCtrl.lockMouse();
			if (_kbhit()) {
            	char key = _getch();
            	if(key-'0'==a[i]){
            		break;
				}
			}
		}
		mouseCtrl.unlockMouse();
		system("cls");
	}
	cout<<"你成功了!!"<<endl;
	Sleep(2000);
	cout<<"额,感觉不对,病毒还没完全消灭!!!"<<endl;
	Sleep(3000);
	cout<<"第一个病毒只是打破电脑的防御"<<endl;
	cout<<"剩下的才是真正的大军!!!"<<endl;
	Sleep(3000);
	cout<<"不#@&好"<<endl;
	Sleep(2000);
	cout<<"我$*(*%被病))(&@!毒!:?|{{入侵<>?{@#了"<<endl;
	Sleep(5000);
	cout<<"不..........."<<endl;
	Sleep(2000);
	cout<<"主&$!(((人|}>!@对不*&%起"<<endl;
	Sleep(4000);
	cout<<"接@#$下来要$^&*""靠你^%#自己了"<<endl;
	Sleep(2000);
	system("cls");
	cout<<"哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈"<<endl;
	Sleep(1000);
	cout<<"你的电脑安全管家已经完全被我控制了,哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈"<<endl;
	Sleep(2000);
	cout<<"尽情地打字吧,哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈"<<endl;
	Sleep(3000);
	system("cls");
	string s="HappyNewyearwishyoucanbeyourself";//彩蛋
	for(int i=0;i<32;i++){
		MouseController mouseCtrl;
		cout<<s[i]<<endl;
		while(1){
			mouseCtrl.lockMouse();
			if (_kbhit()) {
            	char key = _getch();
            	if(key==s[i]){
            		break;
				}
			}
		}
		mouseCtrl.unlockMouse();
		system("cls");
	}
	s="comeonyoucanbethebest";//彩蛋
	for(int i=0;i<s.size();i++){
		MouseController mouseCtrl;
		cout<<s[i]<<endl;
		while(1){
			mouseCtrl.lockMouse();
			if (_kbhit()) {
            	char key = _getch();
            	if(key==s[i]){
            		break;
				}
			}
		}
		mouseCtrl.unlockMouse();
		system("cls");
	}
	s="everythingyoumeetwillbegood";//彩蛋
	for(int i=0;i<s.size();i++){
		MouseController mouseCtrl;
		cout<<s[i]<<endl;
		while(1){
			mouseCtrl.lockMouse();
			if (_kbhit()) {
            	char key = _getch();
            	if(key==s[i]){
            		break;
				}
			}
		}
		mouseCtrl.unlockMouse();
		system("cls");
	}
	cout<<"你...你怎么这么厉害!!!!"<<endl;
	Sleep(2000);
	cout<<"你不会是一名搞编程的吧"<<endl;
	Sleep(3000);
	cout<<"唉..........................我甘拜下风"<<endl;
	Sleep(3000);
	cout<<"在我们自毁之前,我代表全体病毒向您发出祝福,祝您在新一年的编程考试里RP++"<<endl;
	Sleep(4000);
	cout<<"祝你每天都开心"<<endl;
	return 0;
}
原文
存档评论1 条抓取于