Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- int[] tab = {1, 8, 1, 1, 5, 7, 1, 1};
- int count = 1, max = 0;
- for (int i = 0; i < tab.Length; i++)
- {
- if ((i + 1) < tab.Length && tab[i] <= tab[i + 1])
- count++;
- else
- {
- if (max < count)
- max = count;
- count = 1;
- }
- }
- Console.WriteLine(max);
- Console.ReadKey();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement