#include<iostream>
#include <ctime>
#include <cstdlib>
#define random(a,b) (rand()%(b-a)+a)
using namespace std;
int main()
{
int a[6], x, z;
cout << "铁汁儿想来几组?" << endl;
cin >> z;
cout << endl;
srand((int)time(0));
for (int i = 0; i < z; i++)
{
for (int i = 0; i < 6; i++)
{
loop:
a[i] = random(1, 34);
for (int j = 0; j < i; j++)
{
if (a[i] == a[j])
{
goto loop;
}
}
}
for (int i = 0; i < 6; i++)
{
int min = 999;
for (int j = 0; j < 6; j++)
{
if (min > a[j])
{
min = a[j];
}
}
for (int k = 0; k < 6; k++)
{
if (a[k] == min)
{
a[k] = 1000;
}
}
if (min < 10)
{
cout << "0" << min << " ";
}
else
{
cout << min << " ";
}
}
x = random(1, 17);
if (x < 10)
{
cout << "0" << x << endl;
}
else
{
cout << x << endl;
}
cout << endl;
}
return 0;
}
双色球随机生成
最新推荐文章于 2023-07-19 20:12:40 发布