daily pastebin goal
75%
SHARE
TWEET

Untitled

a guest May 16th, 2018 108 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program test;
  2. var
  3.     matrix: array[1..6,1..7] of real;
  4.     i, j: integer;
  5.     const p=3;
  6.     q=5;
  7.     var
  8.     matrix2: array[1..7,1..8] of real;
  9.     matrix3: array[1..7,1..8] of real;
  10.  
  11. begin
  12.  
  13.     writeln ('Заполнениние массива случайными числами... ');
  14.  
  15.     for i := 1 to 6 do
  16.         for j := 1 to 7 do
  17.             matrix[i,j]:=random(10)-5;
  18.        
  19.         writeln ('Вывод исходного массива');
  20.     for i := 1 to 6 do begin
  21.         for j := 1 to 7 do
  22.             write (matrix[i,j]:4, ' ');
  23.         writeln
  24.     end;
  25.        
  26.   for i := 1 to 7 do
  27.         for j := 1 to 8 do
  28.             matrix2[i,j]:=0;
  29.   for i := 1 to 3 do
  30.     for j := 1 to 7 do
  31.       matrix2[i,j]:=matrix[i,j];
  32.   for j := 1 to 7 do
  33.   matrix2[4,j]:=random(10)-5;
  34.   for i := 5 to 7 do
  35.   for j:=1 to 7 do
  36.   matrix2[i,j]:=matrix[i-1,j];
  37.  
  38.   for i := 1 to 7 do
  39.     for j := 1 to 8 do
  40.       matrix3[i,j]:=matrix2[i,j];
  41.  
  42.  
  43.   for i := 1 to 7 do
  44.     for j := 1 to 5 do
  45.       matrix2[i,j]:=matrix2[i,j];
  46.   for i := 1 to 7 do
  47.   matrix2[i,6]:=random(10)-5;
  48.   for i := 1 to 7 do
  49.   for j:=7 to 8 do
  50.   matrix2[i,j]:=matrix3[i,j-1];
  51.  
  52.  
  53.              
  54. writeln ('Вывод нового массива');
  55.     for i := 1 to 7 do begin
  56.         for j := 1 to 8 do
  57.             write (matrix2[i,j]:4, ' ');
  58.         writeln
  59.     end;
  60.  
  61. end.
RAW Paste Data
Top