BasicKnowledgeCSharp/LessonsAndTasks/Lesson 33 - Ступенчатые (зубчатые) массивы/Program.cs
Dvurechensky bf6a7c2b4e 1.1
2025-05-12 02:48:54 +03:00

51 lines
1.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* Author: Nikolay Dvurechensky
* Site: https://www.dvurechensky.pro/
* Gmail: dvurechenskysoft@gmail.com
* Last Updated: 12 мая 2025 02:47:11
* Version: 1.0.3
*/
using System;
/*
* Cтупенчатые (зубчатые) массивы
*/
class Program
{
static void Main()
{
int[][] test1 = new int[3][];
int[,] test2 = new int[3, 6];
int tes1Rank = test1.Rank;
int test2Rank = test2.Rank;
int tes1Lenght = test1.Length;
int test2Lenght = test2.Length;
test1[0] = new int[5];
test1[1] = new int[8];
test1[2] = new int[2];
test1[0][2] = 6;
Console.WriteLine(test1[0][2]);
Random rnd = new Random();
for (int i = 0; i < test1.Length; i++)
{
for (int k = 0; k < test1[i].Length; k++)
{
test1[i][k] = rnd.Next(100);
}
}
for (int i = 0; i < test1.Length; i++)
{
for (int k = 0; k < test1[i].Length; k++)
{
Console.Write(test1[i][k] + "\t");
}
Console.WriteLine();
}
Console.ReadKey();
}
}