一个十分简单的猜数游戏(源码):
#include
using namespace std;
void main()
{
int a;
for
(cout<<“请输入一个数:”<<endl;
cin>>a;
)if(a<25)
{
cout<<“数太小了,往大里猜猜”<<endl;
}
else if(a>25)
{
cout<<“数太大了,往小里猜猜。”<<endl;
}
else if(a==25)
{
cout<<“恭喜你,猜对了。”<<endl;
cout<<“输入任何数字继续猜数,输入任何字母则退出猜数。”<<endl;
int y=7;
cin>>y;
cout<<“请输入一个数:”<<endl;
continue;
}
return;
}
一个十分简单的猜数游戏(源码)
最新推荐文章于 2023-10-22 16:35:54 发布