int n = 3, min=0, max = 0, sum=0;                 Random test = new Random();                 int[][] arr = new int[n][];                 for (int i = 0; i < n; i++)                 {                     arr[i] = new int[n];                     for (int j = 0; j < n; j++)                     {                         arr[i][j] = test.Next(0, 100);                         Console.Write(arr[i][j] + "\t");                                              if (arr[i][j] < arr[min/n][min%n])                         {                             min = (i*n) + (j);                         }                         if (arr[i][j] > arr[max / n][max % n])                         {                             max = (i * n) + (j);                         }                     }                     Console.WriteLine();                 }                 Console.Write("min = "+arr[min/n][min%n]+"\tmax = "+arr[max/n][max%n]);                  if (min > max)                     SwapInteger(ref min, ref max);                  for (int i = min + 1; i < max; i++)                 {                     sum += arr[i/n][i%n];                 }                 Console.WriteLine("\n"+sum);