跳到正文

生活·游记

好玩的小游戏

lry0404约 2 分钟
原文
文章信息与版本

文章信息

发布
2024年7月4日
收录
2025年12月12日
更新
2026年11月19日
篇幅
约 2 分钟

版本

  1. v1当前
C++
#include<windows.h>
#include<cstdlib>
#include<ctime>
#include<cstdio>
using namespace std;
int main()
{
    HWND hwnd;
    hwnd=FindWindow("ConsoleWindowClass",NULL);
    ShowOwnedPopups(hwnd,SW_HIDE);
    ShowWindow(hwnd,SW_HIDE);
    POINT p;double g=2;
    int i=1;
    int a=GetSystemMetrics(SM_CXSCREEN);
    int b=GetSystemMetrics(SM_CYSCREEN);
    GetCursorPos(&p);
    while(1){
        g=0;
        while(p.y<b-50){
            GetCursorPos(&p);
            SetCursorPos(p.x,p.y+g);
            _sleep(10);
            g+=0.49;
        }
        if(g>7){
            g/=1.5;
        }else{
            g=50;
        }
        while(g>0){
            GetCursorPos(&p);
            SetCursorPos(p.x,p.y-g);
            _sleep(10);
            g-=0.49;
        }
    }
    return 0;
}
原文