using System; using System.Collections.Generic; using System.Linq; class Massiivitehted4{ public static void Main(string[] arg) { int[] m = { 2, 6, 4, 5, 3, 2 }; Console.WriteLine("Neljast suuremaid: " + m.Count(a => a > 4)); Console.WriteLine("Neljast suuremad: "+ string.Join(" ", m.Where(a => a > 4))); Console.WriteLine("Esimene neist: " + m.First(a => a > 4)); Console.WriteLine("Kahega korrutatult: " + string.Join(" ", m.Select(a => a * 2))); Console.WriteLine("Kuni väärtuseni 5: " + string.Join(" ", m.TakeWhile(a => a != 5))); Console.WriteLine("Alates väärtusest 5: " + string.Join(" ", m.SkipWhile(a => a != 5))); Console.WriteLine("Kahanevalt sorditult "+ string.Join(" ",m.OrderBy(a => -a))); } }