#include<windows.h>
#include<ctime>
using namespace std;
int main()
{
int x=GetSystemMetrics(SM_CXSCREEN);
int y=GetSystemMetrics(SM_CYSCREEN);
srand(time(0));
while(true)
{
SetCursorPos(rand()%x,rand()%y);
}
return 0;
}
运行之后你的鼠标就会在屏幕上乱跑,根本不受控制。
你可以按键盘上的Alt+F4或Alt+Fn+F4,这样就可以关掉运行程序,恢复原状了!