Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- int[] numbers = {2,4,4,10,10,4,4,2};
- bool isSymmetric = true;
- for( int i = 0; i < numbers.Length / 2; i++)
- {
- if (numbers[i] != numbers[numbers.Length - 1 - i])
- {
- isSymmetric= false;
- }
- }
- if (isSymmetric)
- {
- Console.WriteLine("Mасивът е симетричен");
- }
- else
- {
- Console.WriteLine("Mасивът не е симетричен!");
- }
- }
- }
Add Comment
Please, Sign In to add comment