using System.Collections.Generic;
static void Main(string[] args)
List<int> numbers = new List<int> { 19, -10, 12, -6, -3, 34, -2, 5, 19, 12, 34, 5 };
List<int> empty = new List<int>();
empty=EnterNumbersTillZero();
public static void PrintList(List<int>num)
public static List<int> RemoveAllEntries(List<int>num)
public static List<int> RemoveAllPositive(List<int>num)
num.RemoveAll(n => n > 0);
public static List<int> RemoveAllNegativeDivisible2(List<int>num)
num.RemoveAll(n => n < 0 && n % 2 == 0);
public static List<int> RemoveAllPositiveDivisible3(List<int>num)
num.RemoveAll(n => n > 0 && n % 3 == 0);
public static List<int>RemovePositiveDiv2AndNegativeDiv3(List<int>num)
num.RemoveAll(n => n >= 0 && n % 2 == 0);
num.RemoveAll(n => n <= 0 && n % 3 == 0);
public static void FindSameValuesWholeList(List<int>num)
var duplicate = num.GroupBy(x => x)
.Where(g => g.Count() > 0)
.Select(y => new { Value = y.Key, Count = y.Count() })
foreach (var dupl in duplicate)
Console.WriteLine(dupl.Value+" "+dupl.Count);
public static void FindSameValuesRepeatedValuesList(List<int>num)
.Where(y => y.Count() > 1)
.Select(g => new { Value = g.Key, Count = g.Count() })
foreach (var dupl in duplicates)
Console.WriteLine(dupl.Value + " " + dupl.Count);
public static List<int> EnterNumbersTillZero()
List<int> numbers = new List<int>();
successParse = int.TryParse(Console.ReadLine(), out num);
} while (num!=0||!successParse);
public static void PrintAverage(List<int>numbers)
numbers.RemoveAll(x => x > 10);
else if(numbers.Average() < 0)
numbers.RemoveAll(x => x < -10);
Console.WriteLine(numbers.Average());