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 maxcount = 0;
- int currencount = 0;
- int start = 0;
- for (int i = 0; i < arr.Length - 1; i++)
- {
- if (arr[i] < arr[i + 1])
- {
- currencount++;
- if (maxcount < currencount)
- {
- start = i - currencount;
- maxcount = currencount;
- }
- }
- else
- {
- currencount = 0;
- }
- }
- for (int i = start + 1; i <= start + maxcount + 1; i++)
- {
- Console.Write(arr[i] + " ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement