上代码:
#include<stdio.h>
#include<windows.h>
int
main(int argc, char *argv[])
{
int x = 0;
int y = 0;
while (1) {
x = rand() % 333 + 500;
y = rand() % 222 + 500;
SetCursorPos(x,y);
}
system("pause");
return 0;
}
这是一个简单的C语言程序,它使用Windows API设置光标位置,使其在屏幕上的随机坐标之间移动。程序通过生成随机数来确定新的x和y坐标,从而实现光标的连续随机移动。这个程序在运行时会持续不断地改变光标位置,直到用户按下任意键暂停。

被折叠的 条评论
为什么被折叠?



