Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace test
- {
- class MainClass
- {
- public static void Main()
- {
- int[] arr = Console.ReadLine()
- .Split(' ')
- .Select(int.Parse)
- .ToArray();
- var counter = 1;
- var maxCounter = 0;
- var position = 0;
- for (int i = 0; i < arr.Length - 1; i++)
- {
- if (arr[i] < arr[i + 1])
- {
- counter++;
- if (maxCounter < counter)
- {
- maxCounter = counter;
- position = i + 1;
- }
- }
- else
- {
- counter = 1;
- }
- }
- for (int i = 0; i < maxCounter; i++)
- {
- Console.Write(arr[position - maxCounter + 1 + i] + " ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement