Advertisement
Ronka

Untitled

Jun 8th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _8zad
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int[] arr = Console.ReadLine().Split().Select(int.Parse).ToArray();
  14.  
  15.  
  16. int maxcount = 0;
  17. int currencount = 0;
  18. int start = 0;
  19.  
  20. for (int i = 0; i < arr.Length - 1; i++)
  21. {
  22. if (arr[i] < arr[i + 1])
  23. {
  24. currencount++;
  25.  
  26. if (maxcount < currencount)
  27. {
  28.  
  29. start = i - currencount;
  30. maxcount = currencount;
  31.  
  32. }
  33.  
  34. }
  35. else
  36. {
  37. currencount = 0;
  38. }
  39.  
  40.  
  41. }
  42. for (int i = start + 1; i <= start + maxcount + 1; i++)
  43. {
  44. Console.Write(arr[i] + " ");
  45. }
  46.  
  47. }
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement