using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace getmat7
{
class Program
{
static void Main(string[] args)
{
int n;
int[,] A;
n = int.Parse(Console.ReadLine());
A = new int[n + 1, n + 1];
for (int i = 1; i <= n; i++)
for (int j = 1; j <= n; j++)
if (i == j || i + j == n + 1)
A[i, j] = 0;
else if (i < j && i + j < n + 1)
A[i, j] = 1;
else if (i > j && i + j > n + 1)
A[i, j] = 2;
else A[i, j] = 3;
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= n; j++)
Console.Write(A[i, j] + " ");
Console.WriteLine();
}
Console.ReadKey();
}
}
}
|