using System.Collections.Generic;
for (int k = 0; k < A.GetLength(0)-1; k++)
for (int q = 0; q < A.GetLength(1)-1; q++)
for (int i = k; i <2+k; i++)
for (int j = q; j <2+q; j++)
static void Main(string[] args)
Console.WriteLine("Введите размер массива(строку)");
int n = int.Parse(Console.ReadLine());
Console.WriteLine("Введите размер массива(столбец)");
int m = int.Parse(Console.ReadLine());
int[,] A = new int[n, m];
Random rnd = new Random();
for (int i = 0; i < A.GetLength(0); i++)
for (int j = 0; j < A.GetLength(1); j++)
A[i, j] = rnd.Next(-50, 50);
Console.Write(A[i, j] + " ");