Random rnd = new Random();
Console.Write("N = ");
int N = int.Parse(Console.ReadLine());
int K = 0;
List<int> mas = new List<int>(N);
for(int i = 0;i < N;i++)
{
mas.Add(rnd.Next(0, 10));
}
foreach (int i in mas)
Console.Write(i + " ");
Console.Write("\nK = ");
K = int.Parse(Console.ReadLine());
if (K >= 1 && K <= N)
mas.RemoveAt(K - 1);
Console.ReadKey();
Random rnd = new Random();
Console.Write("N = ");
int N = int.Parse(Console.ReadLine());
int K = 0;
List<int> mas = new List<int>(N);
for(int i = 0;i < N;i++)
{
mas.Add(rnd.Next(0, 10));
}
foreach (int i in mas)
{
Console.Write(i + " ");
}
Console.Write("\nK = ");
K = int.Parse(Console.ReadLine());
if (K >= 1 && K <= N)
{
mas.RemoveAt(K - 1);
foreach (int i in mas)
{
Console.Write(i + " ");
}
}
Console.ReadKey();