#include<iostream>
using namespace std;
#include<stdlib.h>
#include<ctime>
int main()
{
srand((int)time(0)); //随机数的时间设置
int num = rand() % 1000 + 1;
while (1)
{
int value = 0;
cin >> value;
if (value > num)
{
cout << "输出过大" << endl;
}
else if (value < num)
{
cout << "输出过小" << endl;
}
else
{
cout << "正确了" << endl;
break; }
}
system("pause");
return 0;
}
猜数游戏(1~1000)c++
于 2023-01-30 13:12:08 首次发布