{"id":2397,"date":"2010-05-11T12:15:43","date_gmt":"2010-05-11T08:15:43","guid":{"rendered":"http:\/\/msbro.ru\/?p=2397"},"modified":"2010-06-25T08:30:05","modified_gmt":"2010-06-25T04:30:05","slug":"pascal-primery-zadach-s-resheniem-mnogomernye-massivy","status":"publish","type":"post","link":"https:\/\/msbro.ru\/index.php\/archives\/2397","title":{"rendered":"Pascal: \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0437\u0430\u0434\u0430\u0447 \u0441 \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c (\u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b)"},"content":{"rendered":"<p><!--more--><\/p>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430 1.<\/strong><\/p>\n<p><em>\u0414\u0430\u043d\u0430 \u043c\u0430\u0442\u0440\u0438\u0446\u0430 NxM, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0430\u044f \u0438\u0437 \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b. \u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0432 \u0441\u0442\u0440\u043e\u043a\u0430\u0445 \u0441\u0430\u043c\u044b\u0435 \u043b\u0435\u0432\u044b\u0435 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u0445 \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446. \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0443\u0436\u043d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0439\u0442\u0438 \u0441\u0430\u043c\u044b\u0439 \u043b\u0435\u0432\u044b\u0439 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u0438 \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0435\u0433\u043e \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u0442\u043e\u043b\u0431\u0446\u0435.<\/em><\/p>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435:<\/p>\n<p style=\"padding-left: 30px;\">a \u2013 \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432;<br \/>\nn, m \u2013 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430;<br \/>\ni, j \u2013 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0446\u0438\u043a\u043b\u0430;<br \/>\njm \u2013 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438;<br \/>\nmin \u2013 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u0438\u043d\u0438\u043c\u0443\u043c.<\/p>\n<p><span style=\"text-decoration: underline;\">\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438:<\/span><\/p>\n<ol>\n<li> \u0432\u0432\u043e\u0434\u0438\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0410 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432;<\/li>\n<li>\u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0441\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043e, \u0438\u0449\u0435\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432;<\/li>\n<li>\u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043c\u0435\u043d\u044f\u0435\u043c \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u0442\u043e\u043b\u0431\u0446\u0435;<\/li>\n<li>\u0432\u044b\u0432\u043e\u0434\u0438\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d.<\/li>\n<\/ol>\n<pre>const t=100; s=100;\r\nvar a : array [1..t,1..s] of integer;\r\n    n, m, jm, i, j, min : integer;\r\nbegin\r\n    write('\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a n=');\r\n    readln(n);\r\n    write('\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 m=');\r\n    readln(m);\r\n    for i:=1 to n do\r\n      begin\r\n         write('\u0412\u0432\u043e\u0434\u0438\u0442\u0435 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0431\u0435\u043b', m,'\u0447\u0438\u0441\u0435\u043b');\r\n         for j:=1 to m do\r\n         read(a[i,j]);\r\n      end;\r\n   for i:=1 to n do\r\n   begin\r\n       min:= a[i,1];\r\n       jm:=1;\r\n         for j:=1 to m do\r\n         if min &gt; a[i,j]\r\n               then\r\n                    begin\r\n                    jm:=j;\r\n                    min:=a[i,j];\r\n                    end;\r\n         a[i,jm]:=a[i,1];\r\n         a[i,1]:=min;\r\n   end;\r\n   for i:=1 to n do          {\u0432\u044b\u0432\u043e\u0434 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0432 \u0432\u0438\u0434\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b}\r\n   begin\r\n       for j:=1 to m do\r\n       write(a[i,j]:4);\r\n       writeln;\r\n   end\r\nend.\r\n<\/pre>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430 2.<br \/>\n<\/strong><\/p>\n<p><em>\u0414\u0430\u043d\u0430 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 NxN, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0430\u044f \u0438\u0437 \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b. \u0417\u0435\u0440\u043a\u0430\u043b\u044c\u043d\u043e \u043e\u0442\u0440\u0430\u0437\u0438\u0442\u044c \u0435\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0431\u043e\u0447\u043d\u043e\u0439 \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438. \u0412\u044b\u0432\u0435\u0441\u0442\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d.<\/em><\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 3&#215;3 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u043f\u0440\u0438 \u0437\u0435\u0440\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438:<\/p>\n<pre>A11 A12 A13           A33 A23 A13\r\nA21 A22 A23   &lt;-&gt;  A32 A22 A12\r\nA31 A32 A33           A31 A21 A11\r\n<\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0443 \u043d\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u043e\u0432\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 B, \u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre>B11 &lt;-&gt; A33\r\nB12 &lt;-&gt; A23\r\nB21 &lt;-&gt; A32\r\nB22 &lt;-&gt; A22 \u0438 \u0442.\u0434., \u0442.\u0435. B[I,J] &lt;-&gt; A[L,M]\r\n<\/pre>\n<p>\u0412\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435, \u043c\u043e\u0436\u043d\u043e \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u044b NxM \u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439:<\/p>\n<pre>I+M = N+1,\r\nJ+L = N+1.\r\n<\/pre>\n<p>\u041e\u0442\u0441\u044e\u0434\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre>B[I,J] = A[N+1-J,N+1\u2013I].\r\n<\/pre>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435:<\/p>\n<p style=\"padding-left: 30px;\">a, b \u2013 \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b;<br \/>\nm \u2013 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430;<br \/>\ni, j \u2013 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0446\u0438\u043a\u043b\u0430;<br \/>\nk\u2013 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f.<\/p>\n<p><span style=\"text-decoration: underline;\">\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438:<\/span><\/p>\n<ol>\n<li> \u0432\u0432\u043e\u0434\u0438\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430 A \u0438 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c;<\/li>\n<li>\u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u044b B \u043f\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u0432\u044b\u0448\u0435 \u0444\u043e\u0440\u043c\u0443\u043b\u0430\u043c \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0438\u0445 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d.<\/li>\n<\/ol>\n<p>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u0440\u0435\u0448\u0430\u044e\u0449\u0430\u044f \u0434\u0430\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre>const n=100;\r\nvar a,b : array [1..n] of integer;\r\n    k, m, i, j : integer;\r\nbegin\r\n       write('\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u0430\u0442\u0440\u0438\u0446\u044b m=');\r\n       readln(m);\r\n       writeln('\u0418\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430');\r\n       k:=1;\r\n       for i:=1 to m do\r\n            for j:=1 to m do\r\n             begin\r\n                 a[i,j]:=k; k:=k+1;\r\n                 if j<\/pre>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430 3.<br \/>\n<\/strong><\/p>\n<p>\u0412\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c:<\/p>\n<p><strong><em>\u0430) \u0421 = A + B<\/em><\/strong><\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0432\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b:<\/p>\n<p style=\"padding-left: 30px;\">1) tab_in ( var a1 : mas ) \u2013 \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0441 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u04301 \u2013 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432;<br \/>\n2) tab_out ( var b1 : mas ) \u2013 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 b1 \u2013 \u0438\u043c\u044f \u0432\u044b\u0432\u043e\u0434\u0438\u043c\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/p>\n<pre>type mas=array [1..40,1..40] of real;\r\n        vec=array[1..40] of real;\r\nvar a,b,c : mas;\r\n      x,y : vec;\r\n      i, j, n, k : integer;\r\n      r, s : real;\r\nprocedure tab_in(var a1 : mas);\r\nvar i, j : integer;\r\nbegin\r\n     for i:=1 to n do\r\n         for j:=1 to n do\r\n         read(a1[i,j]);\r\n     writeln;\r\nend;\r\n<\/pre>\n<pre>procedure tab_out(var b1 : mas);\r\nvar i,j:integer;\r\nbegin\r\n     for i:=1 to n do\r\n     begin\r\n         for j:=1 to n do\r\n         write(b1[i,j]:7:3);\r\n     writeln;\r\n     end;\r\nend;\r\n<\/pre>\n<pre>begin\r\n       writeln('\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u0430\u0442\u0440\u0438\u0446\u044b');\r\n       readln(n);\r\n       writeln('\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 A');\r\n       tab_in(a);\r\n       writeln('\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 B');\r\n       tab_in(b);\r\n       writeln('\u041c\u0430\u0442\u0440\u0438\u0446\u0430 A');\r\n       tab_out(a);\r\n       writeln('\u041c\u0430\u0442\u0440\u0438\u0446\u0430 B');\r\n       tab_out(b);\r\n       for i:=1 to n do\r\n           for j:=1 to n do\r\n              c[i,j]:=a[i,j]+b[i,j];\r\n       writeln('\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 C=A+B');\r\n       tab_out(c);\r\nend.\r\n<\/pre>\n<p><em><strong>\u0431) y = A * x<\/strong><\/em><\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430<\/p>\n<pre>begin\r\n      writeln('\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u0430\u0442\u0440\u0438\u0446\u044b');\r\n      readln(n);\r\n      writeln('\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 A');\r\n      tab_in(a);\r\n      writeln('\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0432\u0435\u043a\u0442\u043e\u0440 x');\r\n      for i:=1 to n do read(x[i]);\r\n      writeln;\r\n      writeln('\u041c\u0430\u0442\u0440\u0438\u0446\u0430 A');\r\n      tab_out(a);\r\n      writeln('\u0412\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 x');\r\n      for i:=1 to n do write(x[i]:7:2);\r\n      writeln;\r\n      for i:=1 to n do\r\n      begin\r\n            s:=0;\r\n            for j:=1 to n do\r\n                     s:=s+A[i,j]*x[j];\r\n            y[i]:=s\r\n      end;\r\n      writeln('\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 y=A*x');\r\n      for i:=1 to n do\r\n      write (y[i]:7:3);\r\n      writeln;\r\nend.\r\n<\/pre>\n<p><strong><em>\u0432) \u0421 = A * B<\/em><\/strong><\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430<\/p>\n<pre>begin\r\n       writeln('\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u0430\u0442\u0440\u0438\u0446\u044b');\r\n        readln(n);\r\n        writeln('\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 A');\r\n        tab_in(a);\r\n        writeln('\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 B');\r\n        tab_in(b);\r\n        writeln('\u041c\u0430\u0442\u0440\u0438\u0446\u0430 A');\r\n        tab_out(a);\r\n         writeln('\u041c\u0430\u0442\u0440\u0438\u0446\u0430 B');\r\n        tab_out(b);\r\n        for i:=1 to n do\r\n             for j:=1 to n do\r\n             begin\r\n                     s:=0;\r\n                     for k:=1 to n do\r\n                             s:=s+a[i,k]*b[k,j];\r\n                     c[i,j]:=s;\r\n            end;\r\n        writeln('\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 C=A+B');\r\n        tab_out(c);\r\nend.\r\n<\/pre>\n<p><strong><em>\u0433) \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443 B<\/em><\/strong><\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430:<\/p>\n<pre>begin\r\n        writeln('\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u0430\u0442\u0440\u0438\u0446\u044b');   readln(n);\r\n        writeln('\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 B'); tab_in(b);\r\n        writeln('\u041c\u0430\u0442\u0440\u0438\u0446\u0430 B'); tab_out(b);\r\n        for i:=1 to n\u20131 do\r\n              for j:=i+1 to n do\r\n              begin\r\n                  r:=b[i,j]; b[i,j]:=b[j,i]; b[j,i]:=r;\r\n             end;\r\n        writeln;\r\n        writeln('\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0430\u044f \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 B');\r\n        tab_out(b);\r\nend.\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[600,13],"tags":[599,602],"class_list":["post-2397","post","type-post","status-publish","format-standard","hentry","category-programming","category-education","tag-pascal","tag-mnogomernye-massivy"],"_links":{"self":[{"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/posts\/2397"}],"collection":[{"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/comments?post=2397"}],"version-history":[{"count":0,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/posts\/2397\/revisions"}],"wp:attachment":[{"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/media?parent=2397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/categories?post=2397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/tags?post=2397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<!-- WP Super Cache is installed but broken. The constant WPCACHEHOME must be set in the file wp-config.php and point at the WP Super Cache plugin directory. -->