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

implementation

  procedure Sum_Vekt;

   var i:integer;

    begin

      write('Vector 1 = ');

      for i:=1 to n do

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

      writeln;

      write('Vector 2 = ');

      for i:=1 to n do

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

      for i:=1 to n do

      for i:=1 to n do

       c[i]:=a[i]+b[i];

      writeln;

      write('Rezyltat slojeniya= ');

      for i:=1 to n do

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

      writeln;

       readln;

    end;

end.
Результат

                       Vect_Mattr_Operations

        Menu:

  a) ymnozenie vektora i skalyara;

  b) symma 2 vectorov;

  c) skalyarnoe ymnozenie vektorov;

  d) ymnozenie matrici i skalyra;

  e) ymnozenie matrici i vektora;

  f) symma 2 matric;

  g) ymnozenie 2 matric.;

 Vv. pynkt menu:

a

a * Sk

VV. fail n.d.:

a:\1\VectSk.txt

Skaliar = 5.0

Vector = 4.0  6.0  3.0  2.0  1.0  5.0  8.0  9.0  4.0  3.0

Rezultat = 20.0  30.0  15.0  10.0  5.0  25.0  40.0  45.0  20.0  15.0

Vv. pynkt menu:

b

a + b

VV. fail n.d.:

a:\1\SumVect.txt

Vector 1 = 4.0 6.0 3.0 7.0 9.0 5.0 1.0 4.0 7.0 5.0

Vector 2 = 3.0 6.0 5.0 1.0 8.0 7.0 4.0 9.0 8.0 6.0

Rezyltat slojeniya= 7.0 12.0 8.0 8.0 17.0 12.0 5.0 13.0 15.0 11.0

Vv. pynkt menu:

c

(a.b)

a + b

VV. fail n.d.:

a:\1\SumVect.txt

Vector1= 4.0 6.0 3.0 7.0 9.0 5.0 1.0 4.0 7.0 5.0

vector2= 3.0 6.0 5.0 1.0 8.0 7.0 4.0 9.0 8.0 6.0

Scolarnoe proizvedenie dvyh vektorov s = 303.00000

 Vv. pynkt menu:

d

x * Sk

VV. fail n.d.:

a:\1\MatrSk.txt

Skaliar=4.0

Nachalnaja matrica

3.0 5.0 2.0 6.0 7.0

6.0 4.0 2.0 1.0 7.0

7.0 6.0 4.0 8.0 9.0

4.0 2.0 1.0 6.0 8.0

7.0 6.0 9.0 6.0 3.0

--| We have Result |--

12.0 20.0 8.0   24.0 28.0

24.0 16.0 8.0   4.0   28.0

28.0 24.0 16.0 32.0 36.0

16.0 8.0   4.0   24.0 32.0