using System.Collections.Generic;
public static void Main()
Random num = new Random();
List<int> numbers = new List<int>();
for( ; numbers.Count < 5; )
int index = num.Next(1, 10);
if(numbers.Contains(index))
Console.Write("Now output the random number list:");
foreach(int index in numbers)
Console.Write(" " + index);
Console.Write("Now output the random number list after remove:");
foreach(int index in numbers)
Console.Write(" " + index);
public static void RemoveAllEven(List<int> list)
for(int i = 0; i < list.Count; )