Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace ascedning
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             int n = int.Parse(Console.ReadLine());
  13.             int br = 1;
  14.             int max = 1;
  15.  
  16.             if (n > 0)
  17.             {
  18.                 var a = int.Parse(Console.ReadLine());
  19.                 for (int i = 2; i <= n; i++)
  20.                 {
  21.                     var b = int.Parse(Console.ReadLine());
  22.                     if (b > a)
  23.                     {
  24.                         br++;
  25.                         if (br > max)
  26.                         {
  27.                             max = br;
  28.                         }
  29.                     }
  30.                     else
  31.                     {
  32.                         br = 1;
  33.                     }
  34.                     a = b;
  35.                 }
  36.                 Console.WriteLine(max);
  37.             }
  38.             else
  39.             {
  40.                 Console.WriteLine(0);
  41.             }
  42.         }
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement