Лаба2.1

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
program lab2;
const
M=2;
N=3;
Type
T_matr=array [1..M,1..N] of Integer;
Procedure Read_Matr (var Matr:T_Matr);
Var I,J: byte;
Begin
For I:=1 to M do
For J:=1 to N do
Read (Matr [I,J]);
End;
Function Prov_otr (I:Byte; Matr:T_Matr): boolean;
Var
J: Byte;
Prov: boolean;
Begin
Prov:=true;
J:=1;
While Prov and (J<=N)do
begin
Prov:=Prov and (Matr[I,J]>0);
J:=J+1;
end;
Prov_otr:=Prov;
End;
Function Find_Mul (I:Byte;Matr:T_Matr):Integer;
Var
J: Byte;
Mul:Integer;
Begin
Mul:=1;
For J:=1 to N do
Mul:=Mul*Matr[I,J];
Find_Mul:=Mul;
End;
Var
Matr:T_Matr;
I:Byte;
BEGIN
WriteLN ('Vvedite matrix M*N');
Read_Matr (Matr);
For I:=1 to M do
If (Prov_otr(I,Matr))
then WriteLN ('Proizvedenie ',I,' = ',Find_Mul(I,Matr));
END.