public static void Main()
Console.WriteLine("Ingrese el valor del tamaño de la matriz");
Console.WriteLine("El valor debe de ser Impar y positivo");
nres = int.Parse(Console.ReadLine());
}while(nres % 2 == 0 || nres < 0);
int[,] matriz = new int[nres,nres];
for(int j = 0; j < matriz.GetLength(1); j++)
for(int i = 0; i < j+1; i++)
matriz[fl++,cl--] = valor++;
for(int j = matriz.GetLength(1)-1; j >= 0; j--)
for(int i = 0; i < j; i++)
matriz[fl++, cl--] = valor++;
for(int fl = 0; fl < nres; fl++)
for(int cl = 0; cl < nres; cl++)
Console.Write(matriz[fl,cl] + "\t");