Лабораторная работа №1. Программирование векторных и матричных операций, страница 8

var j,i:integer;

begin

  write('Vector = ');

  for i:=1 to n do

    write(a[i]:0:1,' ');

  writeln;

  writeln('Nachalnaja matrica');

  for i:=1 to n do

  begin

    for j:=1 to n do

      write(x[i,j]:0:1,' ');

    writeln;

  end;

  writeln;

  writeln('Rezultat');

  for i:=1 to n do

  begin

    a1[i]:=0;

    for j:=1 to n do

    begin

      a1[i]:=a1[i]+x[i][j]*a[j];

      write(a1[i]:0:1,' ');

    end;

    writeln;

  end;

end;

end.

Unit U_mult_vect_Sk;

interface

uses U_VVOD;

procedure Mylt_Vect_SK(sk:real; n:integer; a:vector; var a1:vector);

implementation

  procedure Mylt_Vect_SK;

   var i:integer;

    begin

      writeln('Skaliar = ',sk:0:1);

      write('Vector = ');

      for i:=1 to n do

        write(a[i]:0:1,'  ');

      writeln;

      write('Rezultat = ');

      for i:=1 to n do

      begin

      a1[i]:=sk*a[i];

      write(a1[i]:0:1,'  ');

    end;

  end;

end.

Unit U_ScolPrVect;

 interface

  uses crt, U_VVOD;

  procedure Scolar_Pr_vekv(n:integer;a,b:vector; var sk1: real);

 implementation

  procedure Scolar_Pr_vekv;

   var s:real; i:integer;

   begin

    s:=0;

     for i:=1 to n do

      s:=s+a[i]*b[i];

    writeln('Scolarnoe proizvedenie dvyh vektorov s = ',s:2:5);

    readln;

   end;

End.

unit U_Sum_Matr;

interface

 uses crt,u_vvod;

 procedure sum_matr(n:integer; x,y:matrix;var z:matrix);

implementation

 procedure sum_matr;

 var i,j:integer;

 begin

  for i:=1 to n do

  begin

   for j:=1 to n do

    begin

     z[i,j]:=x[i,j]+y[i,j];

     write(z[i,j]);

    end;

   writeln;

  end;

  readln;

 end;

end.

unit U_Sum_vekt;

interface

uses u_vvod;

    procedure Sum_Vekt(n:integer; a,b: vector;var c:vector);