//2010-01 猜数字
#include <iostream>
using namespace std;
int main()
{
srand(time(NULL));
int a = rand() % 900 + 100;
int t = 1;
for (int i = 0; i < 10; i++)
{
int b;
cin >> b;
if (a == b)
{
cout << "恭喜你,猜对了" << endl;
t = 0;
break;
}
else
if (i == 9 && a != b)
cout << "ByeBye" << endl;
else
if (b < a)
cout << "猜小了,请继续" << endl;
else
cout << "猜大了,请继续" << endl;
}
return 0;
}
hdu 笔试2010-01
最新推荐文章于 2024-07-25 21:43:46 发布