Esempio n. 1
0
        static void Main(string[] args)
        {
            int[] stones = Console.ReadLine()
                           .Split(',', StringSplitOptions.RemoveEmptyEntries)
                           .Select(int.Parse)
                           .ToArray();

            Lake lake = new Lake(stones);

            Console.WriteLine(string.Join(", ", lake));
        }
        public static void Main(string[] args)
        {
            int[] stones = Console.ReadLine()?
                           .Split(", ", StringSplitOptions.RemoveEmptyEntries)
                           .Select(int.Parse)
                           .ToArray();
            Lake       lake = new Lake(stones);
            List <int> path = new List <int>();

            foreach (var stone in lake)
            {
                path.Add(stone);
            }
            Console.WriteLine(string.Join(", ", path));
        }