public static void Main(string[] args)
double middle = 0, sum = 0;
double[] arr = new double[5] { 1, 2, 3, 4, 5 };
double[,] arr2 = new double[2, 2] { { 1, 2 }, { 3, 4 } };
Console.WriteLine("Одномерный массив:");
for (int i = 0; i < 5; i++)
Console.WriteLine("Двумерный массив:");
for (int i = 0; i < 2; i++)
for (int j = 0; j < 2; j++)
Console.WriteLine("Введите а:");
a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Введите b:");
b = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(" Одномерный массив с рандомными числами:");
Console.WriteLine("Двумерный массив с рандомными числами:");
Console.Write("Введите N: ");
N = Convert.ToInt32(Console.ReadLine());
double[] numbers = new double[N];
FillArray(numbers, a, b);
for (int i = 0; i < N; i++)
Console.WriteLine("Сумма равна = {0}, Среднее занчение равно = {1}", sum, middle);
static void ArrayView(double x)
Console.Write(Convert.ToString(x) + " ");
static void ArrayView2(double x)
Console.Write(Convert.ToString(x) + " ");
static void FillArray(double[] x, int a, int b)
Random rand = new Random();
for (int i = 0; i < x.GetLength(0); i++)
Console.Write(Convert.ToString(x[i]) + " ");
static void FillArray2(double[,] x, int a, int b)
Random rand = new Random();
for (int i = 0; i < x.GetLength(0); i++)
for (int j = 0; j < x.GetLength(1); j++)
x[i, j] = rand.Next(a, b);
Console.Write(x[i, j] + " ");