public static void Main(string[] args)
        {
            List<int> sequence = new List<int>();

            while (true)
            {
                string line = Console.ReadLine();

                if (line == string.Empty)
                {
                    break;
                }

                int number = int.Parse(line);
                sequence.Add(number);
            }

            SequenceFinder finder = new SequenceFinder();

            List<int> longestEqualSequence = finder.GetEqualNumbersSubsequence(sequence);

            foreach (int number in longestEqualSequence)
            {
                Console.WriteLine(number);
            }
        }
Пример #2
0
        public static void Main(string[] args)
        {
            List <int> sequence = new List <int>();

            while (true)
            {
                string line = Console.ReadLine();

                if (line == string.Empty)
                {
                    break;
                }

                int number = int.Parse(line);
                sequence.Add(number);
            }

            SequenceFinder finder = new SequenceFinder();

            List <int> longestEqualSequence = finder.GetEqualNumbersSubsequence(sequence);

            foreach (int number in longestEqualSequence)
            {
                Console.WriteLine(number);
            }
        }