游戏系列之不眨眼游戏

hi,hi!今天我来给大家提供一款难度为:⭐⭐(共5星)的游戏:

不眨眼游戏!!!

我想这么简单的游戏不需要我来讲了,😅😅😅,但是有一个地方我还是要讲一下,这个计时方式可能你们不知道。

这个要用到stdio库,用来提供时间(单位:毫秒)

接下来提供代码:

#include <windows.h>
#include<stdio.h>
using namespace std;
int main() {
    int a;
    double b;
    a = 1000; 
    b = 0.0;
    cout<<"hi,hi!眨眼游戏来喽!"<<endl;
	Sleep(3000);
	cout<<"准备好了吗?" <<endl;
	cout<<"3"<<endl;
	Sleep(a); 
	cout<<"2"<<endl;
	Sleep(a);
	cout<<"1"<<endl;
	Sleep(a);
	cout<<"go!"<<endl;
	while(b <= 5.0){
		cout<<b<<endl;
		Sleep(100);
		b = b+0.1;
	}
	cout<<"闭眼休息一下吧,如果你刚刚没眨眼那么你获得了称号:"<<endl;
	cout<<"		睁眼大师"<<endl;
	Sleep(5000);
	cout<<"3"<<endl;
	Sleep(a); 
	cout<<"2"<<endl;
	Sleep(a);
	cout<<"1"<<endl;
	Sleep(a);
	cout<<"go!"<<endl;
	b = 0;
	while(b <= 10.0){
		cout<<b<<endl;
		Sleep(100);
		b = b+0.1;
	}
	cout<<"闭眼休息一下吧,如果你刚刚没眨眼那么你获得了称号:"<<endl;
	cout<<"		刚直不屈"<<endl;
	Sleep(5000);
	cout<<"3"<<endl;
	Sleep(a); 
	cout<<"2"<<endl;
	Sleep(a);
	cout<<"1"<<endl;
	Sleep(a);
	cout<<"go!"<<endl;
	b = 0;
	while(b <= 15.0){
		cout<<b<<endl;
		Sleep(100);
		b = b+0.1;
	}
	cout<<"闭眼休息一下吧,如果你刚刚没眨眼那么你获得了称号:"<<endl;
	cout<<"		不是人,是鬼魂!(开个玩笑)"<<endl;
	Sleep(5000);
	cout<<"好啦,游戏就到这里,你能突破自己的极限吗?";
	Sleep(2000); 
    return 0;
}

这里用到“Sleep”代码,它会让计算机等待1秒,用“Sleep”感觉的确很形象哦!😊😊😊 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值