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 _8zad
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] arr = Console.ReadLine().Split().Select(int.Parse).ToArray();
- int currencount = 1;
- int maxcount = 0;
- int currentelement = 0;
- int minelement = int.MinValue;
- int start = 0;
- int end = 0;
- for (int i = 1; i < arr.Length; i++)
- {
- if (arr[i-1] < arr[i])
- {
- start = i;
- currencount++;
- currentelement = arr[i - 1];
- if (maxcount < currencount)
- {
- end = i;
- start = i - currencount;
- maxcount = currencount;
- }
- }
- else
- {
- currencount = 1;
- }
- if (maxcount < currencount)
- {
- minelement = currentelement;
- maxcount = currencount;
- }
- }
- for (int i = start + 1; i < end + 1; i++)
- {
- Console.Write(arr[i] + " ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement