Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _08.IncreasingElements
- {
- class IncreasingElements
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int countCurrentLongest = 0;
- int countLongest = 0;
- int aPrev = 0;
- int a = 0;
- for (int i = 0; i < n; i++)
- {
- a = int.Parse(Console.ReadLine());
- if (a > aPrev)
- {
- countCurrentLongest++;
- }
- else
- {
- countCurrentLongest = 1;
- }
- if (countCurrentLongest > countLongest)
- {
- countLongest = countCurrentLongest;
- }
- aPrev = a;
- }
- Console.WriteLine(countLongest);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement