Advertisement
koksibg

Increasing_Sequence_of_Elements

Feb 17th, 2017
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.82 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 Increasing_Sequence_of_Elements
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int[] number = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
  14.             int count = 0;
  15.            
  16.             for (int i = 0; i < number.Length; i++)
  17.             {
  18.                 count++;
  19.                     if (number[count] > number[i])
  20.                     {
  21.                         if (count == number.Length -1)
  22.                         {
  23.                             Console.WriteLine("Yes");
  24.                             return;
  25.                         }
  26.                     }
  27.                     else
  28.                     {
  29.                         Console.WriteLine("No");
  30.                         return;
  31.                     }
  32.                 }  
  33.             }
  34.         }
  35.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement