Advertisement
Guest User

05IncreasingSequenceofElements

a guest
Feb 16th, 2017
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. namespace _05IncreasingSequenceofElements
  2. {
  3. using System;
  4. using System.Linq;
  5.  
  6. class IncreasingSequenceofElements
  7. {
  8. static void Main()
  9. {
  10. int[] arrayInput = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
  11. bool isIncremental = true;
  12.  
  13. for (int i = 1; i < arrayInput.Length; i++)
  14. {
  15. if (arrayInput[i] < arrayInput[i - 1])
  16. {
  17. isIncremental = false;
  18. break;
  19. }
  20. }
  21. if (isIncremental)
  22. {
  23. Console.WriteLine("Yes");
  24. }
  25. else
  26. {
  27. Console.WriteLine("No");
  28. }
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement