示例#1
0
        static void Main(string[] args)
        {
            List <int> inputStones = Console.ReadLine().Split(", ", StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToList();
            Lake       myLake      = new Lake(inputStones);

            Console.WriteLine(string.Join(", ", myLake));
        }
示例#2
0
        static void Main(string[] args)
        {
            var        input   = Console.ReadLine().Split(", ", StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToList();
            Lake <int> numbers = new Lake <int>(input);

            Console.WriteLine(string.Join(", ", numbers));
        }
示例#3
0
        static void Main()
        {
            int[] stoneValues = Console.ReadLine().Split(", ").Select(int.Parse).ToArray();
            Lake  lake        = new Lake(stoneValues);

            Console.WriteLine(string.Join(", ", lake));
        }
示例#4
0
        public static void Main()
        {
            int[] stones = Console.ReadLine().Split(new char[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
            Lake  lake   = new Lake(stones);

            Console.WriteLine(string.Join(", ", lake));
        }
示例#5
0
        static void Main(string[] args)
        {
            var  input = Console.ReadLine().Split(", ", StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
            Lake lake  = new Lake(input);

            Console.WriteLine(String.Join(", ", lake));
        }
示例#6
0
        public static void Main()
        {
            var        stonesInLake = Console.ReadLine().Split(new[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToList();
            Lake <int> lake         = new Lake <int>(stonesInLake);

            Console.WriteLine(string.Join(", ", lake));
        }
示例#7
0
        public static void Main()
        {
            var stones = Console.ReadLine().Split(", ").Select(int.Parse).ToArray();
            var lake   = new Lake(stones);

            Console.WriteLine(string.Join(", ", lake));
        }
示例#8
0
        static void Main()
        {
            var stones = Console.ReadLine().Split(", ", StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToList();
            var lake   = new Lake(stones);

            Console.WriteLine(string.Join(", ", lake));
        }
示例#9
0
        static void Main(string[] args)
        {
            Lake lake = new Lake(Console.ReadLine().Split(new[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries)
                                 .Select(int.Parse).ToList());
            IList <int> stones = lake.Stones;
            IList <int> even   = new List <int>();
            IList <int> odd    = new List <int>();

            for (int i = 0; i < lake.Stones.Count; i++)
            {
                if (i % 2 == 0)
                {
                    even.Add(stones[i]);
                }
                else
                {
                    odd.Add(stones[i]);
                }
            }

            List <int> combined = new List <int>();

            combined.AddRange(even);
            combined.AddRange(odd.Reverse());

            Console.WriteLine(string.Join(", ", combined));
        }
示例#10
0
        static void Main(string[] args)
        {
            int[] input = Console.ReadLine().Split(", ").Select(int.Parse).ToArray();
            Lake  lake  = new Lake(input);

            Console.WriteLine(string.Join(", ", lake));
        }
示例#11
0
        public static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(", ").Select(int.Parse).ToArray();

            var list = new Lake(input);

            Console.WriteLine(string.Join(", ", list));
        }
示例#12
0
        public static void Main()
        {
            var stones = Console.ReadLine().Split(new[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse);

            var myLake = new Lake(stones);

            Console.WriteLine(string.Join(", ", myLake));
        }
示例#13
0
        static void Main(string[] args)
        {
            List <int> stones = Console.ReadLine().Split(", ").Select(int.Parse).ToList();

            Lake lake = new Lake(stones);

            Console.WriteLine(string.Join(", ", lake));
        }
示例#14
0
        public static void Main(string[] args)
        {
            var numbers = Console.ReadLine().Split(", ").Select(int.Parse).ToList();

            var lake = new Lake(numbers);

            Console.WriteLine(string.Join(", ", lake));
        }
示例#15
0
        static void Main(string[] args)
        {
            int[] array = Console.ReadLine().Split(new char[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();

            Lake lake = new Lake(array);

            Console.WriteLine(string.Join(", ", lake));
        }
示例#16
0
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(", ").Select(int.Parse);

            Lake <int> lake = new Lake <int>(input);

            Console.WriteLine(string.Join(", ", lake));
        }
        static void Main(string[] args)
        {
            int[] stones = Console.ReadLine().Split(", ").Select(int.Parse).ToArray();

            Lake lake = new Lake(stones); // или директно можем да подадем параметрите: Lake lake = new Lake(1,2,3,4)

            Console.WriteLine(string.Join(", ", lake));
        }
示例#18
0
        public static void Main()
        {
            var lake = new Lake(Console.ReadLine()
                                .Split(new string[] { ", " }, StringSplitOptions.RemoveEmptyEntries)
                                .Select(int.Parse)
                                .ToList());

            Console.WriteLine(string.Join(", ", lake));
        }
示例#19
0
        static void Main(string[] args)
        {
            IList <int> numbers = Console.ReadLine().Split(new char[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries)
                                  .Select(int.Parse).ToList();
            Lake lake = new Lake(numbers);

            Console.WriteLine(String.Join(", ", lake));
            Console.ReadLine();
        }
示例#20
0
        static void Main(string[] args)
        {
            Lake <int> myLake = new Lake <int>();

            int[] input = Console.ReadLine().Split(", ", StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();

            myLake.AddElements(input);

            Console.WriteLine(string.Join(", ", myLake));
        }
示例#21
0
        private static Lake Cross(Lake lake)
        {
            var crossedLake = new List <int>();

            foreach (var stone in lake)
            {
                crossedLake.Add(stone);
            }
            return(new Lake(crossedLake));
        }
示例#22
0
        public static void Main()
        {
            var input = Console.ReadLine()
                        .Split(new char[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries)
                        .Select(int.Parse).ToArray();

            var lake = new Lake(input);

            Console.WriteLine(string.Join(", ", lake));
        }
示例#23
0
        static void Main(string[] args)
        {
            List <int> numbers = Console.ReadLine()
                                 .Split(", ", StringSplitOptions.RemoveEmptyEntries)
                                 .Select(int.Parse)
                                 .ToList();
            Lake lake = new Lake(numbers);

            Console.WriteLine(string.Join(", ", lake.GetFrogPath()));
        }
示例#24
0
        static void Main(string[] args)
        {
            var stoneNumbers = Console.ReadLine()
                               .Split(", ")
                               .Select(int.Parse)
                               .ToArray();
            var lake = new Lake(stoneNumbers);

            Console.WriteLine(String.Join(", ", lake));
        }
示例#25
0
        static void Main(string[] args)
        {
            var arr = Console.ReadLine()
                      .Split(", ")
                      .Select(int.Parse)
                      .ToArray();
            var lakes = new Lake(arr);

            Console.WriteLine(string.Join(", ", lakes));
        }
示例#26
0
        static void Main()
        {
            List <int> input = Console.ReadLine()
                               .Split(", ")
                               .Select(int.Parse)
                               .ToList();

            var stone = new Lake(input);

            Console.WriteLine(string.Join(", ", stone));
        }
示例#27
0
        public static void Main(string[] args)
        {
            var stones = Console.ReadLine()
                         .Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
                         .Select(int.Parse)
                         .ToList();

            var lake = new Lake <int>(stones);

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

            //Lake lake = new Lake(new int[] { 1, 2, 3, 4, 5 });// this would work just with constructor with params
            Console.WriteLine(string.Join(", ", lake));
        }
示例#29
0
        public static void Main(string[] args)
        {
            int[] inputData = Console.ReadLine()
                              .Split(", ", StringSplitOptions.RemoveEmptyEntries)
                              .Select(int.Parse)
                              .ToArray();

            Lake myLake = new Lake(inputData);

            Console.WriteLine(String.Join(", ", myLake));
        }
示例#30
0
        static void Main(string[] args)
        {
            var arr = Console.ReadLine()
                      .Split(", ", StringSplitOptions.RemoveEmptyEntries)
                      .Select(int.Parse)
                      .ToArray();

            var frogJumps = new Lake(arr);

            Console.WriteLine(string.Join(", ", frogJumps));
        }