栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

C++ 猜数字游戏之全英文版

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

C++ 猜数字游戏之全英文版

希望大家能采用。(*_*)

第一次发布,真的不容易!

啥也不说了,上代码!

#include
using namespace std;
int main()
{
	char j;
	srand(time(0));
	cout<<"Game name: guess numbers"<>y;
	    if(y=='A') l=1,m=100,x=rand()%100+1,k=25;//设置最大值,最小值,次数上限
	    else if(y=='B') l=1,m=1000,x=rand()%1000+1,k=50;
	    else if(y=='C') l=1,m=10000,x=rand()%10000+1,k=100;
	    else if(y=='D')
	    {
	    	cout<<"Please enter the minimum and maximum values!"<=0)
	    	{
	    		if(a[r]>='0'&&a[r]<='9') a1+=(a[r]-'0')*r1;//将字符型变成整型
	    		else
	    		{
	    			cout<<"Input error, the game is over!"<=0)
			{
				if(b[o]>='0'&&b[o]<='9') b1+=(b[o]-'0')*o1;
				else
				{
					cout<<"Input error, the game is over!"<=b1||b1<=a1||b1>=10000)//判断是否超出范围
	    	{
	    		cout<<"Input error, the game is over!"<=m);//循环刷出合适的数
	    	if(m>=100) k=100;
	    	else k=10;
			cout<<"OK!Setup complete!"<1) cout<<" again!"<1) cout<<"Tip: you have guessed "<>n;
		    if(n>x)//偏小
		    {
			    cout<<"You guessed wrong!"<k) cout<<"You guessed too many times! Come on next time!"<>j;
	    if(j=='1') cout<<"OK, let's have another round!"<
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/1009831.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号