一个鼠标乱晃的程序
2025-07-23 18:50:52
发布于:浙江
#include<iostream>
#include<stdlib.h>
#include<conio.h>
#include<windows.h>
#include<ctime>
using namespace std;
void color(const int &a){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),a);
}
void bug(){
int x=GetSystemMetrics(SM_CXSCREEN);
int y=GetSystemMetrics(SM_CYSCREEN);
int q=300000;
while(q--){
SetCursorPos(rand()%x,rand()%y);
Sleep(100);
color(rand()%15+1);
cout<<"看来你这个人人品很差\n但不要担心,一会就好了" ;
system("cls");
}
}
int main(){
srand(time(0));
while(1){
char a,no,yes;
cout<<"看人品的时候到了,请盲选吧,请一定不要乱选\n";
cout<<"a.选项\nb.选项\n(直接选字母)";
int aq=rand()%100+1;
if(aq<50){
yes='a';
no='b';
}else{
yes='b';
no='a';
}
cin>>a;
if(a==yes){
system("cls");
cout<<"你幸运的保住了你的电脑,但不要因此庆幸";
return 0;
}else{
std::cout<<"你的电脑即将卡崩,倒计时5秒";
Sleep(1000);
system("cls");
for(int i=5;i>=1;i--){
cout<<i<<"\n";
Sleep(1000);
}
bug();
return 0;
}
}
return 0;
}
全部评论 3
是的是的我用的平板没鼠标
1周前 来自 广东
06
1周前 来自 江苏
0
我看着满屏乱晃的鼠标满脸沉默地写下了这条评论
1周前 来自 浙江
06
1周前 来自 浙江
0
有帮助,赞一个