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 _16_Array_Symmetry
- {
- class Program
- {
- static void Main(string[] args)
- {
- var text = Console.ReadLine()
- .Split(new char[] { ' ' },
- StringSplitOptions.RemoveEmptyEntries)
- .ToArray();
- var lenght = text.Length / 2;
- var result = "Yes";
- //for (int cnt = 0; cnt < lenght; cnt++)
- //{
- // var firstPart = text[cnt];
- // var secondPart = text[text.Length - 1 - cnt];
- // if (firstPart != secondPart)
- // {
- // result = "No";
- // break;
- // }
- //}
- var compareText = new string[text.Length];
- for (int cnt = 0; cnt < compareText.Length; cnt++)
- {
- compareText[cnt] = text[cnt];
- }
- for (int cnt1 = 0; cnt1 < lenght / 2; cnt1++)
- {
- for (int cnt2 = compareText.Length; cnt2 >= 0; cnt2--)
- {
- if (text[cnt1] != compareText[cnt2 - 1])
- {
- result = "No";
- break;
- }
- }
- }
- Console.WriteLine(result);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement