我有一个这样的程序:
using namespace std;
int main()
{
srand(time());
int izlases_sk, a, b, c, d, e;
cout << "Enter 5 numbers" << endl;
cin >> a;
cin >> b;
cin >> c;
cin >> d;
cin >> e;
cout << endl;
for (int x = 0; x < 20; x++)
{
izlases_sk = rand() % 77;
cout << izlases_sk << "\t";
if( izlases_sk == a || izlases_sk == b || izlases_sk == c || izlases_sk == d || izlases_sk == e)
cout << " You predicted this number!\t";
else
cout << "No\t";
{
if (a > 77 || b > 77 || c > 77 || d > 77 || e > 77)
goto end;
}
if ((x + 1) % 5 == 0)
cout<<endl;
}
end:
getch ();
}
我希望我的随机生成的数字一个一个地输出,中间有 1 秒的延迟。我该怎么做?
示例: c++ generate 76
,然后在一秒钟后生成下一个数字。