Program Lab_6;
Type T2m=array [0..10,0..10] of integer;
Tname=string[5];
Var X1, X2, X3, X4:T2m;
N1,N2,N3,N4:byte;
Ya3, Yb3:real;
S1, S2, S3, S4:integer;
D:real;
Procedure Vvod2m (var A:T2m; var N:byte; const Name:TName);
Var i,j:byte;
begin
writeln ('vvedite massiv', Name, ':');
write ('razmernost massiva N=');
readln (N);
for i:=1 to N do
for J:=1 to N do
begin
write (Name, '[', i, ',',j,']=');
readln (A[i,j]);
end;
end;
Procedure Vivod2m(const A:T2m; const N:byte; const Name:TName);
var i,j:byte;
begin
writeln ('vivodim massiv', Name, ':');
for i:=1 to N do
begin
for j:=1 to N do
write (A[i,j]:5);
writeln;
end;
end;
Function SummPol (A:T2m;N:byte):integer;
Var S:integer;
i,j:byte;
SummaPol:integer;
Begin
S:=0;
for i:=1 to N do
For J:=1 to N do
if A[i,j]>0 then
S:=S+A[i,j];
SummaPol:=S;
End;
Function Dlina (p,q,r:integer):real;
Var i,j:byte;
D:real;
Begin
D:=sqrt(sqr(p)+sqr(q)+sqr®);
Dlina:=D;
writeln (D);
end;
Begin
Vvod2m (X1, N1,'X1');
Vvod2m (X2, N2,'X2');
Vvod2m (X3, N3,'X3');
Vvod2m (X4, N4,'X4');
Vivod2m (X1, N1,'X1');
Vivod2m (X2, N2,'X2');
Vivod2m (X3, N3,'X3');
Vivod2m (X4, N4,'X4');
S1:=SummPol(X1,N1);
S2:=SummPol(X2,N2);
S3:=SummPol(X3,N3);
S4:=SummPol(X4,N4);
D:=Dlina(s1,s2,s3);
D:=Dlina(s2,s3,s4);
END.
Помоги сделать правильно....
Сообщение отредактировано: S-Vanek007 -