跳到正文

休闲·娱乐

整人小游戏改编(不要提前看代码)来自 cxk_ctrl

_114514_114514_约 4 分钟
原文
文章信息与版本

文章信息

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

版本

  1. v1当前
C++
#include <bits/stdc++.h>
#include <windows.h>
#include <ctime>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
using namespace std;
void SlowDisplay(char *p,int x)
{
    while(1)
    {
        if(*p!=0) printf("%c",*p++);
        else break;
	Sleep(x);
    }
}
//逐字说话 
//SlowDisplay("慢慢说出这句话,字与字之间间隔300ms",300);
int in;
int main()
{
	SlowDisplay("欢迎来到[不要关闭程序]挑战!",26);
	cout<<endl;
	SlowDisplay("游戏规则:在游戏进行时不要关闭运行窗口,直到程序彻底终止,若提前关闭了窗口则算失败!",26);
	cout<<endl;
	Sleep(1000);
	SlowDisplay("准备好了吗?输入1开始!",35);
	cin>>in;
	if(in!=1)
	{
		system("cls");
		cout<<"6";
		return 0;
	}
	system("cls");
	Sleep(1000); 
	SlowDisplay("你开始了游戏!!!很好!!!等我给你讲个故事你就赢啦!",150);
	cout<<endl;
	Sleep(800);
	SlowDisplay("唉,等我先上个厕所!",80);
	Sleep(3000);
	cout<<endl;
	SlowDisplay("ok你赢了!!!",130); 
	cout<<endl;
	cout<<"--------------------------------"<<endl;
	cout<<"Process exited after 11.45 seconds with return value 0"<<endl;
	cout<<"请按任意键继续. . ."<<endl;
	Sleep(3500);
	system("cls");
	SlowDisplay("......",70);
	Sleep(1000);
	SlowDisplay("好吧没骗到你",50);
	Sleep(1000);
	cout<<endl;
	cout<<"--------------------------------"<<endl;
	cout<<"Process exited after 20 seconds with return value 0"<<endl;
	system("pause");
	system("cls");
	SlowDisplay("..........",50);
	Sleep(1000);
	cout<<endl;
	SlowDisplay("又没骗到你!啊气死我了!你是不是装了国家反诈中心PC版啊!!!",50);
	Sleep(1000);
	cout<<endl;
	SlowDisplay("算了,现在我开始讲故事,",40);
	for(int i=0;i<10;i++){
		SlowDisplay("从前有座山,山上有座庙,庙里老和尚正在给小和尚讲故事,故事的内容是:",10);
	}
	SlowDisplay("从前有座山,山上有座庙,庙里老和尚正在给小和尚讲故事。",50);
	cout<<endl;
	SlowDisplay("谢谢你的欣赏!",50);
	cout<<endl;
	cout<<"--------------------------------"<<endl;
	cout<<"Process exited after 50 seconds with return value 0"<<endl;
	system("pause");
	system("cls");
	SlowDisplay("家人们谁懂啊,这你都没被骗!",50);
	SlowDisplay("行,你牛逼",50);
	system("cls");
	SlowDisplay("好了,不跟你玩了,See You!",50);
	system("cls"); 
	Sleep(1000); 
	return 0;
}
原文