-
个人简介
示例1:鼠标乱飞
这个代码通过随机生成屏幕坐标,让鼠标在屏幕上随机移动。
#include <windows.h> #include 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; }
-
通过的题目
-
最近活动
-
最近编写的题解
This person is lazy and didn't write any solutions.
题目标签
- 基础语法
- 7
- 循环结构
- 6
- 输入输出
- 3
- 循环嵌套
- 3
- 一本通编程启蒙
- 1
- 数组
- 1
- 选择结构
- 1
- 嵌套循环
- 1