int[] ss = new int[6];
Random s = new Random();
Console.WriteLine("雙色球隨機:");
for (int i = 0; i < 6; i++)
{
bool b = true;
int a = s.Next(1, 34);
for (int j = 0; j < i; j++)
{
if (a == ss[j])
{
b = false;
i--;
}
}
if (b)
{
ss[i] = a;
}
}
Console.Write("紅球:\t");
for (int i = 0; i < 6; i++)
{
for (int j = i; j < 5; j++)
{
if (ss[i] > ss[j + 1])
{
int zhong = ss[i];
ss[i] = ss[j + 1];
ss[j + 1] = zhong;
}
}
Console.Write(ss[i] + "\t");
}
for (int i = 0; i < 7 ; i++)
{
int b = s.Next(1, 17);
if (i == 6)
{
Console.Write("藍球:" + b + "\t");
}
else
{
continue ;
}
}
Console.ReadLine();