【c++】运动会1.1.1

我修复了Windows7系统运行太快的BUG

对了,这个也要下载b_game3.0

#include<iostream>
#include<conio.h>
#include<windows.h>
#include<D:\b_game.h>
#include<ctime>
#include<cstdlib>
using namespace std;
using namespace _game;
bool cx_flag = 1;
long long ydjf = 0, pbjl = 1000000000000000000, tyjl = 0;
//页面函数
void zy();
//功能函数
void cd_in();
void cd_out();
//模式函数
void paobu();
void tiaoyuan();
int main()
{
	srand(time(0));
	gckdx(30, 100);
	ycbj();
	gckm("运动会");
	ycgb();
	yanse(15);
	system("cls");
	cout << "正在读入数据...";
	cd_in();
	system("cls");
	bout("一年一度的运动会开始了...");
	cout << "\n\n" << "按任意键继续...";
	_getch();
	system("cls");
	bout("这次,你又要参加什么比赛呢?");
	cout << "\n\n" << "按任意键继续...";
	_getch();
	system("cls");
	while (cx_flag)
	{
		zy();
	}
	system("cls");
	cout << "正在储存数据...";
	cd_out();
	return 0;
}
void zy()
{
	short _n = 0;
	char s;
	system("cls");
	if (ydjf > 0)
	{
		cout << "运动积分:" << ydjf << "\n";
		_n++;
	}
	if (pbjl != 1000000000000000000)
	{
		cout << "跑步最高记录:" << pbjl / 1000.0 << "秒\n";
		_n++;
	}
	if (tyjl != 0)
	{
		cout << "跳远最高记录:" << (tyjl - 6) / 5.0 << "m";
		_n++;
	}
	for (long long i = 1; i <= 8 - _n; i++)
		cout << "\n";
	cout << "                                         运动会";
	cout << "\n\n\n                                         0.退出";
	cout << "\n\n\n                                         1.跑步";
	cout << "\n\n\n                                         2.跳远";
	s = _getch();
	while (s != '0' && s != '1' && s != '2')s = _getch();
	switch (s)
	{
	case '0':
		cx_flag = 0;
		return;
	case '1':
		paobu();
		break;
	case '2':
		tiaoyuan();
		break;
	}
	return;
}
void cd_in()
{
	cdhs _cd;
	_cd.in(ydjf, "运动积分.binggan");
	_cd.in(pbjl, "跑步记录.binggan");
	_cd.in(tyjl, "跳远记录.binggan");
	return;
}
void cd_out()
{
	cdhs _cd;
	_cd.out(ydjf, "运动积分.binggan");
	_cd.out(pbjl, "跑步记录.binggan");
	_cd.out(tyjl, "跳远记录.binggan");
	return;
}
void paobu()
{
	bool flag = 1, f = 0;
	system("cls");
	long long s[6], lc[6] = { 0,1,1,1,1,1 }, y_lc[6] = { 0,1,1,1,1,1 }, yl[6] = { 0,1,1,1,1,1 }, mc = 1, t_1, t_2;
	for (long long i = 1; i <= 5; i++)
	{
		s[i] = rand() % 5 + 6;
		y_lc[i] = lc[i];
	}
	cout << "\n\n\n";
	cout << "-----------------------------------------------------------------------------------\n";
	cout << "|";
	yanse(9);
	cout << "o";
	yanse(15);
	cout << "===============================================================================1|\n";
	cout << "|";
	yanse(9);
	cout << "o";
	yanse(15);
	cout << "===============================================================================2|\n";
	cout << "|";
	yanse(10);
	cout << "o";
	yanse(15);
	cout << "===============================================================================3|\n";
	cout << "|";
	yanse(9);
	cout << "o";
	yanse(15);
	cout << "===============================================================================4|\n";
	cout << "|";
	yanse(9);
	cout << "o";
	yanse(15);
	cout << "===============================================================================5|\n";
	cout << "----------------------------------------------------------------------------------\n";
	cout << "\n----------------------------------------------------------------------------------------------------";
	cout << "说明:\n";
	cout << "    空格 前进/开始\n";
	yanse(10);
	cout << "    o ";
	yanse(15);
	cout << "你\n";
	yanse(9);
	cout << "    o ";
	yanse(15);
	cout << "对手\n";
	while (!axj(' '));
	for (long long i = 1; i <= 5; i++)
		y_lc[i] = lc[i];
	t_1 = clock();
	for (long long cs = 1; flag; cs++)
	{
		long long t = clock();
		//输入
		if (axj(' '))
		{
			if (!f)
			{
				f = 1;
				lc[3]++;
			}
		}
		else f = 0;
		//检测
		for (long long i = 1; i <= 5; i++)
		{
			if (cs % ((12 - s[i]) * 2) == 0)
			{
				if (i != 3 && yl[i])
				{
					lc[i]++;
				}
			}
		}
		for (long long i = 1; i <= 5; i++)
		{
			if (lc[i] > 80 && yl[i])
			{
				if (i == 3)
				{
					yanse(15);
					system("cls");
					t_2 = clock();
					cout << "你得了第" << mc << "名\n";
					if (mc == 1)
					{
						ydjf += 10;
						cout << "运动积分+10\n";
					}
					if (t_2 - t_1 < pbjl)
					{
						pbjl = t_2 - t_1;
						cout << "你打破了你的记录\n";
						cout << "运动积分+30\n";
						ydjf += 30;
					}
					cout << "\n按Enter键继续";
					while (!axj(Enter));
					system("cls");
					cd_out();
					return;
				}
				else
				{
					yl[i] = 0;
					mc++;
				}
			}
		}
		//更新游戏
		for (long long i = 1; i <= 5; i++)
		{
			if (y_lc[i] != lc[i])
			{
				ydgb(i + 4, y_lc[i] + 1);
				yanse(7);
				cout << "=";
				if (i == 3)
				{
					yanse(10);
				}
				else
				{
					yanse(9);
				}
				ydgb(i + 4, lc[i] + 1);
				cout << "o";
			}
		}
		for (long long i = 1; i <= 5; i++)
			y_lc[i] = lc[i];
		if (clock() - t < 20)
		{
			Sleep(20 - (clock() - t));
		}
	}
	return;
}
void tiaoyuan()
{
	bool f = 1;
	long long h=13, l=0;
	yanse(15);
	system("cls");
	cout << "\n\n\n\n----------------------------------------------------------------------------------------------------";
	yanse(10);
	cout << "\n\n\n\n\n\n\n\no\n";
	yanse(15);
	cout << "-----=----------------------------------------------------------------------------------------------";
	cout << "\n\n----------------------------------------------------------------------------------------------------";
	cout << "说明:\n";
	cout << "    空格前进/开始\n";
	yanse(10);
	cout << "    o ";
	yanse(15);
	cout << "你";
	while (!axj(' '));
	for (long long i = 1; i <= 6; i++)
	{
		l++;
		yanse(10);
		ydgb(h, l);
		cout << "o";
		yanse(15);
		ydgb(h, l-1);
		cout << " ";
		Sleep(100);
	}
	ydgb(h, l);
	yanse(15);
	cout << " ";
	h -= 6;
	ydgb(h, l);
	yanse(10);
	cout << "o";
	for (long long cs = 1; 1; cs++)
	{
		long long t = clock();
		if (axj(' '))
		{
			if (f)
			{
				f = 0;
				l++;
			}
		}
		else
		{
			f = 1;
		}
		if (cs % 50 == 0)
		{
			h++;
		}
		if (h > 13)
		{
			yanse(15);
			system("cls");
			if (tyjl < l)
			{
				tyjl = l;
				cout << "你打破了记录,运动积分+30\n";
				ydjf += 30;
			}
			if ((l-6)/5.0>9)
			{
				cout << "你破了9m大关,运动积分+10\n";
				ydjf += 10;
			}
			cout << "你的成绩是";
			cout << (l - 6) / 5.0;
			cout << "m\n";
			cout << "\n按Enter继续";
			while (!axj(Enter));
			return;
		}
		ydgb(h - 1, l-1);
		cout << " ";
		ydgb(h - 1, l);
		cout << " ";
		ydgb(h,l-1);
		cout << " ";
		ydgb(h, l);
		cout << "o";
		if (clock() - t < 18)
		{
			Sleep(18 - (clock() - t));
		}
	}
	return;
}

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: OpenSSL是一个开源的软件库,用于提供安全通信、加密和解密数据的功能。OpenSSL 1.1.1是OpenSSL项目的一个重要版本,于2018年9月发布。 OpenSSL 1.1.1引入了许多新功能和改进。其中最重要的特性是支持TLS 1.3协议。TLS(Transport Layer Security)是一种用于加密通信的协议,它的版本2.0和1.3之间存在较大差异。在TLS 1.3中,OpenSSL使用更安全的加密算法,提供更快的握手速度,并提供了更好的安全性和隐私保护。 此外,OpenSSL 1.1.1还引入了一些其他改进,包括更好的性能和内存优化,对密码学算法的支持增强,以及修复了一些安全漏洞。它还改善了一些功能,例如证书验证和文件读写操作。通过实现更快的加密和解密速度,OpenSSL 1.1.1可以提供更高效的安全通信。 OpenSSL是广泛使用的安全库,被许多开源和商业软件使用。OpenSSL 1.1.1的发布为开发人员和用户提供了更好的安全性和更多的功能选择。它的引入使得加密通信更加安全和可靠,有助于保护敏感数据的隐私和完整性。 ### 回答2: OpenSSL 1.1.1是一种开源的加密库,用于提供安全通信、数据加密和认证的功能。它是OpenSSL项目的下一个重要版本,带来了许多新特性和改进。 首先,OpenSSL 1.1.1支持TLS 1.3协议,这是一种最新的加密协议,提供更高的安全性和性能。TLS 1.3简化了握手过程,减少了延迟,并强化了安全性。它还包括支持新的密码套件,如ChaCha20-Poly1305和Ed448。 其次,OpenSSL 1.1.1还改善了安全性。它修复了一些潜在的安全漏洞,提高了加密算法的强度,并增强了随机数生成器的质量。此外,它还增加了对密码学硬件的支持,如ARMNEON和AES-NI指令。 另外,OpenSSL 1.1.1还增强了对开发者的支持。它提供了一组新的API,以简化开发人员的使用,并提供了更好的文档和示例代码。这些改进使开发人员能够更轻松地集成和使用OpenSSL功能,从而节省开发时间和精力。 总之,OpenSSL 1.1.1是一项重要的更新,通过引入新特性和改进安全性提供了更强大和全面的加密功能。无论是在网络通信、数据保护还是身份验证方面,OpenSSL 1.1.1都能提供高级的安全保障。它对于保护数据的完整性和保密性,以及提供安全的通信通道非常重要。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值