Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace Maximum_Sequence
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] array = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
- int maxCount = 0;
- int currCount = 0;
- for (int i = 0; i < array.Length; i++)
- {
- currCount = 1;
- for (int j = i + 1; j < array.Length - 1; j++)
- {
- if (array[i] == array[j])
- {
- currCount++;
- }
- else
- {
- break;
- }
- }
- if (currCount > maxCount)
- {
- maxCount = currCount;
- }
- }
- Console.WriteLine(maxCount);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement