{"id":232077,"date":"2014-08-04T11:07:03","date_gmt":"2014-08-04T07:07:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=232077"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=232077","title":{"rendered":"<span class=\"post_title\">\u041c\u0430\u0441\u0441\u0438\u0432\u044b, \u0438 \u043a\u0430\u043a \u0438\u043c\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442. <\/p>\n<p>  \u041d\u0430\u0447\u043d\u0443 \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043e\u0431\u0449\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0433\u043e. \u041c\u0430\u0441\u0441\u0438\u0432 \u043c\u043e\u0436\u043d\u043e \u043e\u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043e\u0431\u0449\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f. <br \/>  \u041c\u0430\u0441\u0441\u0438\u0432\u044b \u0432 C# \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c:<\/p>\n<p>  1) \u041e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0439 (\u041b\u0438\u043d\u0435\u0439\u043d\u044b\u0439, \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0439)<br \/>  2) \u0414\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0439 (\u041c\u0430\u0442\u0440\u0438\u0447\u043d\u044b\u0439, \u043c\u0430\u0441\u0441\u0438\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432) <br \/>  3) \u041c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0435 (\u0422\u0440\u0435\u0445\u043c\u0435\u0440\u043d\u044b\u0435 \u0438 \u0431\u043e\u043b\u0435\u0435) <br \/>  4) \u0421\u0442\u0443\u043f\u0435\u043d\u0447\u0430\u0442\u044b\u0435 (\u0417\u0443\u0431\u0447\u0430\u0442\u044b\u0435, Jagged)<br \/>  <a name=\"habracut\"><\/a><br \/>  <b>\u041e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432.<\/b><br \/>  \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u0432\u0438\u0434\u0435: <\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/868\/1c4\/54f\/8681c454f61642c398fa3f87d2f513e1.png\"\/> <\/p>\n<p>  \u041e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u043c\u043e\u0436\u043d\u043e: <br \/>  1) \u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431:  <\/p>\n<pre><code class=\"cs\">int[] arr = new int [13] {1,1,1,1,1,1,1,1,1,1,1,1,1}; <\/code><\/pre>\n<p>  2) \u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434, \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u044a\u0435\u043c\u043d\u044b\u0439:   <\/p>\n<pre><code class=\"cs\">int[] arr = new int[13];             foreach (int index in arr) { arr[index] = 1; }; <\/code><\/pre>\n<p>  3) \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434. \u041d\u043e \u0431\u043e\u043b\u0435\u0435 \u0437\u0430\u0442\u0440\u0430\u0442\u043d\u044b\u0439 \u0434\u043b\u044f \u043f\u0430\u043c\u044f\u0442\u0438:  <\/p>\n<pre><code class=\"cs\">int[] arr = Enumerable.Repeat(1, 13).ToArray(); <\/code><\/pre>\n<p>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c 0 \u0434\u043b\u044f \u0442\u0438\u043f\u0430 int, \u0434\u043b\u044f \u0442\u0438\u043f\u0430 bool = false, \u0434\u043b\u044f \u0442\u0438\u043f\u0430 string = null, \u0434\u043b\u044f char = &#8216;\\0&#8217; (Null character) \u0421 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c, \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e\u0431 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<br \/>  \u042d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"cs\">arr[1] = 2; <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0435\u0441\u044c \u043c\u0430\u0441\u0441\u0438\u0432, \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0432 \u0446\u0438\u043a\u043b\u0435, \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u0432\u0430\u043c   <\/p>\n<pre><code class=\"cs\">for (int index = 0; index &lt; arr.Length - 1;index++ )             { arr[index] = 2; }; <\/code><\/pre>\n<p>  \u0420\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"cs\">Array.Resize(ref arr, 14); <\/code><\/pre>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0441\u043e \u0441\u043a\u0443\u0447\u043d\u044b\u043c\u0438 \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u043c\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043c, \u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u043c.<br \/>  \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p>  \u0414\u043b\u0438\u043d\u0430 \u0442\u0430\u043a\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u0430 12. \u041e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u0430:  <\/p>\n<pre><code class=\"cs\">int[,] arr = new int[3, 4] {                 {1,1,1,1},                 {1,1,1,1},                 {1,1,1,1}             }; <\/code><\/pre>\n<p>  \u0422\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0446\u0438\u043a\u043b\u0435. \u042d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0432\u0438\u0434\u0430: <br \/>  <code>\u0418\u041c\u042f_\u041c\u0410\u0421\u0421\u0418\u0412\u0410 [\u0418\u041d\u0414\u0415\u041a\u0421 \u0421\u0422\u0420\u041e\u041a\u0418, \u0418\u041d\u0414\u0415\u041a\u0421 \u0421\u0422\u041e\u041b\u0411\u0426\u0410] = \u0417\u041d\u0410\u0427\u0415\u041d\u0418\u0415;<\/code><br \/>  \u0420\u0430\u0437\u043c\u0435\u0440 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0447\u0435\u043c \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 Array.Resize(ref [], int) \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432.<br \/>   \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432, \u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 Array.Resize. \u041d\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043f\u0430\u043c\u044f\u0442\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u043c\u0435\u0442\u043e\u0434 \u043a\u0430\u043a Array.Copy \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430\u043c\u0438, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u0430.   <\/p>\n<pre><code class=\"cs\">Array.Copy(arr, newArr, arr.Length);  <\/code><\/pre>\n<p>  \u0412\u0441\u0435 \u044d\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.  <\/p>\n<pre><code class=\"cs\">public static void ResizeArray(ref int[,] arr, int columns, int rows)         {             int[,] newArray = new int[rows, columns];             Array.Copy(arr, newArray, arr.Length);             arr = newArray;} <\/code><\/pre>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0442\u0438\u043f\u0430 int. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u043b\u044e\u0431\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u043d\u0435\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043c\u0435\u0442\u043e\u0434 \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u0438\u044f.   <\/p>\n<pre><code class=\"cs\">public static void ResizeArray&lt;T&gt;(ref T[,] arr, int columns, int rows)         {             T[,] newArray = new T[rows, columns];             Array.Copy(arr, newArray, arr.Length);             arr = newArray;         } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c.<\/p>\n<p>  \u041c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0442\u0440\u0435\u0445\u043c\u0435\u0440\u043d\u044b\u0435. \u041e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u0438\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:   <\/p>\n<pre><code class=\"cs\">int[, ,] arr = new int[2, 5, 2];\/\/- \u041e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0440\u0435\u0445\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 int[, ,..,] arr = new int[2, 5,..,];\/\/-\u041e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0442\u0440\u0435\u0445\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0437\u0443\u043c\u043d\u043e \u0432\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0446\u0438\u043a\u043b\u0430\u0445. \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0447\u0435\u0442\u044b\u0440\u0435\u0445\u043c\u0435\u0440\u043d\u043e\u0433\u043e.  <\/p>\n<pre><code class=\"cs\">for (int i0=0;i0&lt;=arka.GetLength(0)-1;i0++)             {   for (int i1 = 0; i1 &lt;= arka.GetLength(1) - 1; i1++)                 {   for (int i2 = 0; i2 &lt;= arka.GetLength(2) - 1; i2++)                     {   for (int i3 = 0; i3 &lt;= arka.GetLength(3) - 1; i3++)                         {                             arka[i0, i1, i2, i3] = 1;                             Console.Write(arka[i0, i1, i2, i3]);                         }                      }                     }              } <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u043c\u0430\u0441\u0441\u0438\u0432 \u043a\u0430\u043a \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0439, \u043d\u043e \u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435\u043c, \u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0442\u0440\u0443\u0434\u0430. \u0412\u043e\u0437\u044c\u043c\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438 \u0432\u043d\u0435\u0441\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f: <br \/>   1) \u0418\u0437\u043c\u0435\u043d\u0438\u043c \u0442\u0438\u043f \u043c\u0430\u0441\u0441\u0438\u0432\u0430<br \/>   2) \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b <br \/>   3) \u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u0435\u043b\u043e \u043c\u0435\u0442\u043e\u0434\u0430  <\/p>\n<pre><code class=\"cs\">public static void newResizeArray&lt;T&gt;(ref T[,,] arr, int columns, int rows,int dimension)         {             T[,,] newArray = new T[rows, columns,dimension];             Array.Copy(arr, newArray, arr.Length);             arr = newArray;         } <\/code><\/pre>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c \u0441 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u043c\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438.<br \/>  \u0421\u0442\u0443\u043f\u0435\u043d\u0447\u0430\u0442\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u044d\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b. \u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0430\u043a: <br \/>  <code>\u0442\u0438\u043f [][] \u0438\u043c\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u0430 = new \u0442\u0438\u043f[\u0440\u0430\u0437\u043c\u0435\u0440] [];<\/code>  <\/p>\n<pre><code class=\"cs\">int[][] arr = new int[4][];             arr[0] = new int[4];             arr[1] = new int[6];             arr[2] = new int[3];             arr[3] = new int[4]; <\/code><\/pre>\n<p>  \u0418\u0437 \u0442\u0430\u043a\u043e\u0433\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432:<\/p>\n<p>  \u041e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u0442\u0430\u043a\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a: <code>arr[0][0]<\/code><br \/>  \u0420\u0430\u0431\u043e\u0442\u0430 \u0441\u043e \u0441\u0442\u0443\u043f\u0435\u043d\u0447\u0430\u0442\u044b\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c \u0432 \u0446\u0438\u043a\u043b\u0435, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0430\u044f \u0447\u0435\u043c \u0441 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u043c\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043a\u043e\u0434 \u0432\u044b\u0432\u043e\u0434\u0430 \u0441\u0442\u0443\u043f\u0435\u043d\u0447\u0430\u0442\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430:  <\/p>\n<pre><code class=\"cs\">for (int i = 0; i &lt;= arr.GetLength(0)-1; i++)             {                 for (int y = 0; y &lt;= arr[i].Length-1; y++)                 {                     Console.Write(arr[i][y]);                 }            } <\/code><\/pre>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0446\u0438\u043a\u043b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f arr.GetLength(0) \u2013 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043a\u043e\u043b\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432. \u0412\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f arr[i].Length \u2013 \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c i. \u0422\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435 arr[i].GetLength(0). \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u0432 \u044d\u0442\u043e\u043c \u043d\u0435\u0442\u0443. <br \/>  \u0414\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0438\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432, \u043d\u0443\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e. <br \/>  1) \u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u0438\u043f \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<br \/>  2) \u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432.<br \/>  3) \u041f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u0434 \u0432 \u0442\u0435\u043b\u0435 \u043c\u0435\u0442\u043e\u0434\u0430.  <\/p>\n<pre><code class=\"cs\">public static void newResizeArray&lt;T&gt;(ref T[][] arr, int numA)         {             T[][] newArray = new T[numA][];             Array.Copy(arr, newArray, arr.Length);             arr = newArray;         } <\/code><\/pre>\n<p>  \u041d\u043e \u043f\u043e\u0441\u043b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b. \u0418\u043d\u0430\u0447\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c. <br \/>  \u0412 \u0441\u0442\u0443\u043f\u0435\u043d\u0447\u0430\u0442\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b.<br \/>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:   <\/p>\n<pre><code class=\"cs\">int[][,,,] arr = new int[5][,,,]; <\/code><\/pre>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u0436\u0430\u043b\u0443\u0439 \u0432\u0441\u0435. <\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e. \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/232077\/\"> http:\/\/habrahabr.ru\/post\/232077\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442. <\/p>\n<p>  \u041d\u0430\u0447\u043d\u0443 \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043e\u0431\u0449\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0433\u043e. \u041c\u0430\u0441\u0441\u0438\u0432 \u043c\u043e\u0436\u043d\u043e \u043e\u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043e\u0431\u0449\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f. <br \/>  \u041c\u0430\u0441\u0441\u0438\u0432\u044b \u0432 C# \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c:<\/p>\n<p>  1) \u041e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0439 (\u041b\u0438\u043d\u0435\u0439\u043d\u044b\u0439, \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0439)<br \/>  2) \u0414\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0439 (\u041c\u0430\u0442\u0440\u0438\u0447\u043d\u044b\u0439, \u043c\u0430\u0441\u0441\u0438\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432) <br \/>  3) \u041c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0435 (\u0422\u0440\u0435\u0445\u043c\u0435\u0440\u043d\u044b\u0435 \u0438 \u0431\u043e\u043b\u0435\u0435) <br \/>  4) \u0421\u0442\u0443\u043f\u0435\u043d\u0447\u0430\u0442\u044b\u0435 (\u0417\u0443\u0431\u0447\u0430\u0442\u044b\u0435, Jagged)  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-232077","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/232077","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=232077"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/232077\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=232077"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=232077"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=232077"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}