Advertisement
Guest User

ELO

a guest
Jan 24th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.55 KB | None | 0 0
  1.  static void Main(string[] args)
  2.         {
  3.  
  4.  
  5.             int[] tab = {1, 8, 1, 1, 5, 7, 1, 1};
  6.             int count = 1, max = 0;
  7.             for (int i = 0; i < tab.Length; i++)
  8.             {
  9.                 if ((i + 1) < tab.Length && tab[i] <= tab[i + 1])
  10.                     count++;
  11.                 else
  12.                 {
  13.                     if (max < count)
  14.                         max = count;
  15.                     count = 1;
  16.                 }
  17.             }
  18.             Console.WriteLine(max);
  19.             Console.ReadKey();
  20.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement