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 ArraySymmetry
- {
- class Program
- {
- static void Main(string[] args)
- {
- string N = Console.ReadLine();
- string[] MyArray = N.Split(' ').ToArray();
- bool symmetric = true;
- int index = MyArray.Length - 1;
- for (int i = 0; i < MyArray.Length / 2; i++)
- {
- if (MyArray[i] != MyArray[index])
- {
- symmetric = false;
- break;
- }
- index--;
- }
- if (symmetric == true)
- {
- Console.WriteLine("Yes");
- }
- else
- {
- Console.WriteLine("No");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement