Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace two_dimesional_array_2
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[,] array = new int[3, 4];
- for (int row = 0; row < array.GetLength(0); row++) // array.GetLength(0) - дължината на редовете
- {
- for (int col = 0; col < array.GetLength(1); col++) // array.GetLength(1) - дължината на колоните
- {
- array[row, col] = row + col; // Задаване на стойност на елемент
- }
- }
- var rank = array.Rank; // КОЛКО НАБРОЙ ИЗМЕРЕНИЯ ИМА МАСИВА
- Console.WriteLine("БРОЙ ИЗМЕРЕНИЯ НА МАСИВА: {0}",rank);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment