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