Advertisement
YavorGrancharov

Increasing_Sequence_of_Elements

Jun 16th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 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 Increasing_Sequence_of_Elements
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var array = Console.ReadLine().Split().ToArray();
  14.             var newArray = Array.ConvertAll(array, int.Parse);
  15.  
  16.             var result = string.Empty;
  17.  
  18.             for (int i = 0; i < newArray.Length - 1; i++)
  19.             {
  20.                 result = "Yes";
  21.  
  22.                 if (newArray[i] > newArray[i + 1])
  23.                 {
  24.                     result = "No";
  25.                     break;
  26.                 }
  27.             }
  28.             Console.WriteLine(result);
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement