跳到正文

剪贴板

剪贴板 f8fiwmbl

原文
剪贴板信息

剪贴板信息

收录
更新

损人不偿命の代码

鼠标控制器!!!

改良版

C++
#include<bits/stdc++.h>
#include<windows.h>
#include<time.h>
using namespace std;
void move(int x,int y){
	SetCursorPos(x,y);
	return;
}
int main(){
	srand(time(NULL));
	cout<<"我会让你的鼠标像DVD logo一样弹来弹去!\n";
	Sleep(1000);
	POINT p;
	GetCursorPos(&p);
	int x=p.x,y=p.y,xs=2,ys=2;
	cout<<"正在控制你的鼠标...(按下ctrl+c结束)\n如果误触请按ctrl+alt+del";
	//move(rand()%1265,rand()%700);
	while(1){
		if(y<=0){
			ys=2;
		}
		if(y>=700){
			ys=-2;
		}
		if(x<=0){
			xs=2;
		}
		if(x>=1265){
			xs=-2;
		}
		x+=xs;
		y+=ys;
		move(x,y);
		Sleep(1);
	}
	return 0;
}