跳到正文

剪贴板

剪贴板 ke3ebsvv

原文
剪贴板信息

剪贴板信息

收录
更新

欢迎各位来验题!

简介

真理在这里qwq:

  AC  \colorbox{#52C41A}{~~\texttt{\textcolor{white}{AC}}~~} : Answer Coarse,\text{Answer~Coarse},粗劣的答案   CE  \colorbox{#FADB14}{~~\texttt{\textcolor{white}{CE}}~~} : Compile Easily,\text{Compile Easily},轻松通过编译   PC  \colorbox{#E74C3C}{~~\texttt{\textcolor{white}{PC}}~~} : Perfect Compile,\text{Perfect Compile},完美的编译   WA  \colorbox{#E74C3C}{~~\texttt{\textcolor{white}{WA}}~~} : Wonderful Answer,\text{Wonderful Answer},好答案

电脑爆炸专用

C++
#include <bits/stdc++.h>
#include <windows.h>
#include <conio.h>
using namespace std;
int n, x;
long c, t;
namespace Input
{
	bool f;
	void *P;
	template <typename T>
	DWORD WINAPI ThreadProc(LPVOID)
	{
		cin >> *(T *)P;
		f = true;
		return 0ul;
	}
	template <typename T>
	bool WaitInput(T *p, DWORD x)
	{
		f = false, P = p;
		HANDLE handle = CreateThread(nullptr, 0ul, ThreadProc<T>, nullptr, 0ul, new DWORD);
		WaitForSingleObject(handle, x);
		CloseHandle(handle);
		return f;
	}
}

int main()
{
	cout << "等待系统加载...\n";
	t = time(0);
	while(time(0) == t);
	c = clock();
	srand(time(0));
	cout << "输入冒险次数(≥4):";
	if(!Input::WaitInput(&n, 4000))
	{
		cout << endl;
		cout << "不想输入是吧,给你 return 的灾难!\n";
		terminate();
	}
	else if(n < 4)
	{
		cout << "瞧不起我是吧,给你 Div/0 的灾难!\n";
		cout << "混乱值为:" << 1 / (0 * x);
	}
	for(int i = 1; i <= n; i++)
	{
		printf("输入冒险值 (0/1):");
		scanf("%d", &x);
		if(x < 0 || x > 1) printf("乱输入会遭到惩罚哦!\n");
		if(x != rand() % 2)
		{
			time_t t = time(0);
			tm *lc = localtime(&t);
			printf("嘿嘿,你将在 %d/%d/%d %02d:%02d:%02d.%03ld 被第 %d 关终结!\n",
				1900 + lc->tm_year, lc->tm_mon, lc->tm_mday,
				lc->tm_hour, lc->tm_min, lc->tm_sec, (clock() - c) % 1000, i);
			printf("电脑即将在一秒钟后被卡爆!\n");
			Sleep(1000);
			int *p = new int;
			delete p;
			*p = 0;
			printf("居然没坏!混乱值为:%d\n接下来你的电脑将受到伤害!\n", *p);
			*(p + 0x114514) = 114514;
			printf("还是没坏,你的电脑可真行啊!混乱值为:%d\n", *(p + 0x114514));
		}
		else printf("我的妈呀,逃过一劫!\n");
   }
	return 0;
}

运行一下吧!