Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace IncreasingElements
- {
- class Program
- {
- static void Main(string[] args)
- {
- var n = int.Parse(Console.ReadLine());
- var count1 = 0;
- var count2 = 1;
- var numberBefore = -1000;
- for (int i = 1; i <= n; i++)
- {
- var currentnumber = int.Parse(Console.ReadLine());
- if (currentnumber > numberBefore)
- {
- count1++;
- }
- else if (currentnumber <= numberBefore)
- {
- if (count2 < count1)
- {
- count2 = count1;
- count1 = 1;
- }
- currentnumber = -1000;
- }
- numberBefore = currentnumber;
- }
- Console.WriteLine(Math.Max(count1,count2));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement