Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Equal_Sequence_of_Elements_in_Array
- {
- class Program
- {
- static void Main(string[] args)
- {
- string[] inputArray = Console.ReadLine().Split(' ');
- int[] array = new int[inputArray.Length];
- int countEqual = 0;
- for (int i = 0; i < array.Length; i++)
- {
- array[i] = int.Parse(inputArray[i]);
- if (i != 0)
- {
- if (array[i - 1] == array[i])
- {
- countEqual++;
- }
- }
- }
- if (countEqual == array.Length - 1)
- {
- Console.WriteLine("Yes");
- }
- else
- {
- Console.WriteLine("No");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement