Advertisement
plamen27

8 zadacha Incr Elem fixed

Jul 12th, 2016
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace _08_Increasing_Elements
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. var n = int.Parse(Console.ReadLine());
  13. int count = 0;
  14. var b = int.MinValue;
  15.  
  16.  
  17. int countNow = 0;
  18.  
  19. for (int i = 1; i <= n; i++)
  20. {
  21. int a = int.Parse(Console.ReadLine());
  22. if (a > b) { countNow++; }
  23. else { countNow = 1; }
  24. b = a;
  25. if ( count < countNow)
  26. { count = countNow; }
  27. }
  28. Console.WriteLine(count);
  29.  
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement