using System;
class TwoArray
{
static void Main()
{
int[,] numbs = new int[3, 5];
Random rand = new Random();
int[] numb = new int[numbs.Length];
for (int i = 0, z = 0; i < numbs.GetLength(0); i++)
{
for (int j = 0; j < numbs.GetLength(1); j++, z++)
{
numbs[i, j] = rand.Next(0, 100);
Console.Write(numbs[i, j] + " ");
numb[z] = numbs[i, j];
}
Console.WriteLine();
}
Console.WriteLine();
int[,] numbs2 = new int[5, 3];
for (int i = 0, z = 0; i < numbs2.GetLength(0); i++)
{
for (int j = 0; j < numbs2.GetLength(1); j++, z++)
{
numbs2[i, j] = numb[z];
Console.Write(numbs2[i, j] + " ");
}
Console.WriteLine();
}
Console.ReadKey();
}
}
Array.Copy(numbs, numbs2, numbs.Length);
for (int i = 0, z = 0; i < numbs2.GetLength(0); i++)
{
for (int j = 0; j < numbs2.GetLength(1); j++)
{
numbs2[i, j] = numbs[j, i];
Console.Write(numbs2[i, j] + " ");
}
Console.WriteLine();
}
using System;
class TwoArray
{
static void Main()
{
int[,] numbs = new int[3, 5];
Random rand = new Random();
int[,] numbs2 = new int[5, 3];
for (int i = 0, z = 0; i < numbs.GetLength(0); i++)
{
for (int j = 0; j < numbs.GetLength(1); j++, z++)
{
numbs[i, j] = rand.Next(0, 100);
Console.Write(numbs[i, j] + " ");
}
Console.WriteLine();
}
Console.WriteLine();
for (int i = 0; i < numbs2.GetLength(0); i++)
{
for (int j = 0; j < numbs2.GetLength(1); j++)
{
numbs2[i, j] = numbs[j, i];
Console.Write(numbs2[i, j] + " ");
}
Console.WriteLine();
}
Console.ReadKey();
}
}