using System; using System.IO; using System.Linq; class Failid{ public static void Main(string[] arg){ Console.WriteLine(String.Join("\n", Directory.GetFiles("ilmateated"))); Console.WriteLine(String.Join("\n", Directory.GetFiles("ilmateated"). Select(fnimi => fnimi.Split('\\').Last()).OrderBy(fnimi => fnimi.Length). Select(fnimi => fnimi+" - "+fnimi.Length))); Console.WriteLine(String.Join("\n", Directory.GetFiles("ilmateated"). Select(fnimi => fnimi+" - "+File.ReadAllText(fnimi).Length))); Console.WriteLine(Directory.GetFiles("ilmateated"). Select(fnimi => File.ReadAllText(fnimi).Length).Sum()); Console.WriteLine("Ridu failis: "+String.Join("\n", Directory.GetFiles("ilmateated"). Select(fnimi => fnimi+" - "+File.ReadAllLines(fnimi).Length))); Console.WriteLine("Sõnu failis: "+String.Join("\n", Directory.GetFiles("ilmateated"). Select(fnimi => fnimi+" - "+File.ReadAllText(fnimi).Split(' ').Length))); } }