static void Main(string[] args) { int[] stones = Console.ReadLine().Split(", ").Select(int.Parse).ToArray(); Lake lake = new Lake(stones); Console.WriteLine(String.Join(", ", lake)); }
static void Main(string[] args) { var input = Console.ReadLine().Split(", ").Select(int.Parse).ToList(); var stones = new Lake(input); Console.WriteLine(string.Join(", ", stones)); }
public static void Main(string[] args) { int[] stones = Console.ReadLine() .Split(", ", StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse) .ToArray(); Lake <int> lake = new Lake <int>(stones); Console.WriteLine(string.Join(", ", lake)); }
public static void Main() { var elements = Console.ReadLine() .Split(new[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse) .ToArray(); var lake = new Lake <int>(elements); Console.WriteLine(string.Join(", ", lake)); }
public static void Main() { int[] numbers = Console.ReadLine() .Split(", ") .Select(int.Parse) .ToArray(); Lake lake = new Lake(numbers); List <int> result = new List <int>(); foreach (var item in lake) { result.Add(item); } Console.WriteLine(string.Join(", ", result)); }
public static void Main() { Lake lake = new Lake(Console.ReadLine().Split(", ").Select(int.Parse).ToArray()); Console.WriteLine(string.Join(", ", lake)); }