Venciity

[Jumpstart C#] two-dimesional array example 2

Feb 25th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.55 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace two_dimesional_array_2
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int[,] myIntArray = new int[2, 2]
  14.             {
  15.                 {1,2},
  16.                 {9,3}
  17.             };
  18.             myIntArray[1, 0] = 2;
  19.             int element = myIntArray[1, 0];     // от 9 става 2
  20.             Console.WriteLine("Element [1,0] = {0}",element);   // 2
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment