Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace IncreasingElements2
- {
- using System;
- public class IncreasingElements2
- {
- public static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- if (n <= 0)
- {
- Console.WriteLine(0);
- return;
- }
- int firstNum = int.Parse(Console.ReadLine());
- int maxCount = 0;
- int currentCount = 1;
- int count = 1;
- while (count < n)
- {
- int currNum = int.Parse(Console.ReadLine());
- if (currNum > firstNum)
- {
- currentCount++;
- }
- else
- {
- currentCount = 1;
- }
- if (currentCount > maxCount)
- {
- maxCount = currentCount;
- }
- firstNum = currNum;
- count++;
- }
- if (currentCount > maxCount)
- {
- maxCount = currentCount;
- }
- Console.WriteLine(maxCount);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement