在家研究C++的时候,一不小心弄出来个病毒,吓得我赶紧当场重置Windows,却不料是代码块惹的祸,又觉得好玩儿,就分享一下吧。可以在Dev C++上运行,没有的小伙伴可以去开发C++下载|SourceForge.net上下载。
下面,我将源码公布于世......
#include <windows.h>
#include <ctime>
using namespace std;
int main()
{
int x = GetSystemMetrics (SM_CXSCREEN);
int y = GetSystemMetrics (SM_CYSCREEN);
srand (time(0));
while (1) SetCursorPos (rand()%x,rand()%y);
return 0;
}
记得点赞关注哦~