using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _50选9随机数
{
class Program
{
static void Main(string[] args)
{
int i = 0;
int[] num = new int[9];
Random r = new Random();
while (i < 9)
{
num[i] = r.Next(1, 51);
for (int j = 0; j < i; j++)
{
if (num[j] == num[i]&&j!=0)
{
i--;
break;
}
}
i++;
}
for (int j = 0; j < num.Length; j++)
{
Console.Write(num[j] + " ");
}
Console.ReadKey();