using System;
namespace Posledni_Element _Massiva
{
class Program
static void Main(string[] args)
int[,] arr = new int[,] { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } };
int index = (int)Math.Sqrt(arr.Length);
int x = arr[index - 1, index - 1];
Console.WriteLine(x);
}
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
using System;
namespace Posledni_Element _Massiva
{
class Program
{
static void Main(string[] args)
{
int[,] arr = new int[,] { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } };
int index = (int)Math.Sqrt(arr.Length);
int x = arr[index - 1, index - 1];
Console.WriteLine(x);
}
}
}