static void Main(string[] args)
{
FuncOne();
Console.ReadKey();
}
{
public static void FuncOne()
{
Random r=new Random();
List<int> list=new List<int>();
for(int i=0;i<10)
{
int Num=r.Next(1,101);
if(rNum%2==0&&!list.Contains(Num))
{
list.Add(Num);
i++;
}
}
foreach(int j in list)
{
Console.WriteLine(j);
}
}
} |
|